From cbf76bc8fb4962d1b5013528d523c9bd11def9e8 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Fri, 22 Dec 2023 15:07:05 -0500 Subject: [PATCH] added revert-discord-layout --- revert-discord-layout.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 revert-discord-layout.md diff --git a/revert-discord-layout.md b/revert-discord-layout.md new file mode 100644 index 0000000..419b732 --- /dev/null +++ b/revert-discord-layout.md @@ -0,0 +1,30 @@ +# Revert New Discord Layout (but the code is actually proper) + +How to use this script: + +1. Go to the [Discord webapp](https://discord.com/app) +2. Press `Ctrl + Shift + I` to open DevTools +3. Go to the `Console` tab +4. Paste the following code and hit enter: + +```js +let wpRequire; +window.webpackChunkdiscord_app.push([[ Math.random() ], {}, (req) => { wpRequire = req; }]); + +let UserSettingsActions = Object.values(wpRequire.c).find(x => x?.exports?.PreloadedUserSettingsActionCreators).exports; +let ProtobufTypes = Object.values(wpRequire.c).find(x => x?.exports?.BoolValue).exports; + +UserSettingsActions.PreloadedUserSettingsActionCreators.updateAsync("appearance", data => { + data.mobileRedesignDisabled = ProtobufTypes.BoolValue.create({value: true}) +}, UserSettingsActions.UserSettingsDelay.INFREQUENT_USER_ACTION) +``` + +This code requires no changes, preserves all your other appearance settings (such as theme), as well as automatically includes all relevant Discord headers, reducing any risks to minimum. + +## How does this work? + +This emulates flipping the `Show New Layout` toggle in appearance settings. Yes the toggle is server-synced for some reason. + +Note: This is only a temporary solution. Discord will start ignoring that setting in some future update. + +[Original post](https://gist.github.com/aamiaa/fbf6e51dbb8875a781a3d8d76fc3f3e7)