diff --git a/CHANGELOG.md b/CHANGELOG.md index 43c820f5..ff1cfdd1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,22 @@ This changelog starts with the restructured 1.0.0 release that happened after context isolation changes. The changelogs here should more-or-less mirror the ones that get shown in the client but probably with less formatting and pizzazz. +## 1.1.1 + +### Added + +### Removed + +### Changed +- Plugin loader now removes the used `script` tags +- URLs reflect new website + +### Fixed +- Fixed an issue with hiding GIF and Gift buttons +- Fixed certain plugin patches not returning values +- Fixed an issue with the settings patch failing + + ## 1.1.0 ### Added diff --git a/package.json b/package.json index c73c7256..adc2494b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "betterdiscord", - "version": "1.1.0", + "version": "1.1.1", "description": "Enhances Discord by adding functionality and themes.", "main": "src/index.js", "scripts": { diff --git a/renderer/src/builtins/appearance/hidegifbutton.js b/renderer/src/builtins/appearance/hidegifbutton.js index 4618a382..fef1936d 100644 --- a/renderer/src/builtins/appearance/hidegifbutton.js +++ b/renderer/src/builtins/appearance/hidegifbutton.js @@ -9,7 +9,7 @@ export default new class HideGIFButton extends Builtin { enabled() { this.after(WebpackModules.find(m => m.type && m.type.render && m.type.render.displayName === "ChannelTextAreaContainer").type, "render", (_, __, returnValue) => { - const buttons = Utilities.getNestedProp(returnValue, "props.children.0.props.children.1.props.children.1.props.children.2.props.children"); + const buttons = Utilities.getNestedProp(returnValue, "props.children.0.props.children.1.props.children.2.props.children.2.props.children"); if (Array.isArray(buttons)) { for (const button of buttons) { if (!button) continue; diff --git a/renderer/src/builtins/appearance/hidegiftbutton.js b/renderer/src/builtins/appearance/hidegiftbutton.js index 81eb5a22..4f3f7d64 100644 --- a/renderer/src/builtins/appearance/hidegiftbutton.js +++ b/renderer/src/builtins/appearance/hidegiftbutton.js @@ -9,7 +9,7 @@ export default new class HideGiftButton extends Builtin { enabled() { this.after(WebpackModules.find(m => m.type && m.type.render && m.type.render.displayName === "ChannelTextAreaContainer").type, "render", (_, __, returnValue) => { - const buttons = Utilities.getNestedProp(returnValue, "props.children.0.props.children.1.props.children.1.props.children.2.props.children"); + const buttons = Utilities.getNestedProp(returnValue, "props.children.0.props.children.1.props.children.2.props.children.2.props.children"); if (Array.isArray(buttons)) { for (const button of buttons) { if (!button) continue; diff --git a/renderer/src/data/changelog.js b/renderer/src/data/changelog.js index 42bca04f..63b140be 100644 --- a/renderer/src/data/changelog.js +++ b/renderer/src/data/changelog.js @@ -1,41 +1,21 @@ export default { - description: "BetterDiscord is now accepting translations. If you'd like to contribute reach out to an admin about getting access to POEditor.", + description: "This version is a hotfix mainly to fix the settings issue.", changes: [ { - title: "New Features", - type: "added", + title: "Fixes", + type: "fixed", items: [ - "**Media Keys** can now be optionally prevented from being hijacked by Discord in settings.", - "The plugin **RemoveMinimumSize** was absorbed into BetterDiscord and can be enabled in settings.", - "**Update checks** should now happen within BetterDiscord so you won't have to reinstall when BetterDiscord updates.", - "Addon error modals got a __makeover__ thanks to Strencher (https://github.com/Strencher) and Tropical (https://github.com/Tropix126)", - "**Translations** were added thanks to help from the community! Languages include: French, Slovak, Polish, Portuguese (BR), Chinese (Traditional), Chinese (Simplified)" + "Fixed an issue with the settings patch failing", + "Fixed an issue with hiding GIF and Gift buttons", + "Fixed certain plugin patches not returning values", + "Updated links to new website" ] }, { title: "Power Users & Developers", type: "improved", items: [ - "There is a now a command-line option to launch Discord without BetterDiscord injecting itself. Just use `--vanilla`.", - "`ctrl`+`shift`+`c` can now be used globally to activate inspect element, even with devtools closed.", - "Added emote blocklist to `BdApi` via `BdApi.Emotes.blocklist`", - "All console logs can now be logged into the BetterDiscord folder (`BetterDiscord/data//debug.log`) by flipping the switch in settings.", - "The repeated console warnings can be completely removed in Developer Settings." - ] - }, - { - title: "Fixes", - type: "fixed", - items: [ - "**Colored Text**, **Hide GIF Button**, **Hide Gift Button**, and **PublicServers** should all work again", - "Older themes should work with BetterDiscord again.", - "Certain issues with plugins crashing should be fixed.", - "More folders are automatically created to help for those attempting manual or 3rd-party installs.", - "Fixed an issue with an incorrect path being used on Mac.", - "Solved a bug that caused multiple error modals to occur on startup instead of consolidating to one.", - "Emote system should be functional, and the styling has been updating to match Discord's.", - "Using system editor to edit plugins/themes should work instead of causing an error.", - "Fixed a startup issue for users that had all their servers in collapsed folders." + "Certain patches done using `monkeyPatch` instead of `Patcher` now properly return values." ] } ] diff --git a/renderer/src/modules/pluginapi.js b/renderer/src/modules/pluginapi.js index 8d9043b7..4056da43 100644 --- a/renderer/src/modules/pluginapi.js +++ b/renderer/src/modules/pluginapi.js @@ -214,8 +214,9 @@ BdApi.monkeyPatch = function(what, methodName, options) { data.methodArguments = args; data.returnValue = returnValue; try { - Reflect.apply(options[patchType], null, [data]); + const patchReturn = Reflect.apply(options[patchType], null, [data]); if (once) data.cancelPatch(); + return patchReturn; } catch (err) { Logger.err(`${callerId}:monkeyPatch`, `Error in the ${patchType} of ${methodName}`); diff --git a/renderer/src/modules/pluginmanager.js b/renderer/src/modules/pluginmanager.js index 865e12ba..94a8f95a 100644 --- a/renderer/src/modules/pluginmanager.js +++ b/renderer/src/modules/pluginmanager.js @@ -116,6 +116,7 @@ export default new class PluginManager extends AddonManager { delete window.module; delete window.__filename; delete window.__dirname; + container.remove(); return ""; } diff --git a/renderer/src/ui/settings.js b/renderer/src/ui/settings.js index a1cba483..6900ba59 100644 --- a/renderer/src/ui/settings.js +++ b/renderer/src/ui/settings.js @@ -1,4 +1,4 @@ -import {React, WebpackModules, Patcher, ReactComponents, Utilities, Settings, Events, DataStore} from "modules"; +import {React, WebpackModules, Patcher, Utilities, Settings, Events, DataStore} from "modules"; import AddonList from "./settings/addonlist"; import SettingsGroup from "./settings/group"; @@ -60,12 +60,9 @@ export default new class SettingsRenderer { }, options)); } - async patchSections() { - const UserSettings = await ReactComponents.get("UserSettings", m => m.prototype && m.prototype.generateSections); - Patcher.after("SettingsManager", UserSettings.prototype, "render", (thisObject) => { - thisObject._reactInternalFiber.return.return.return.return.return.return.return.memoizedProps.id = "user-settings"; - }); - Patcher.after("SettingsManager", UserSettings.prototype, "generateSections", (thisObject, args, returnValue) => { + patchSections() { + const UserSettings = WebpackModules.getByDisplayName("SettingsView"); + Patcher.after("SettingsManager", UserSettings.prototype, "getPredicateSections", (thisObject, args, returnValue) => { let location = returnValue.findIndex(s => s.section.toLowerCase() == "changelog") - 1; const insert = (section) => { returnValue.splice(location, 0, section); @@ -90,14 +87,13 @@ export default new class SettingsRenderer { insert(panel); } }); - this.forceUpdate(); } forceUpdate() { const viewClass = WebpackModules.getByProps("standardSidebarView").standardSidebarView.split(" ")[0]; const node = document.querySelector(`.${viewClass}`); if (!node) return; - const stateNode = Utilities.findInReactTree(Utilities.getReactInstance(node), m => m && m.generateSections, {walkable: ["return", "stateNode"]}); + const stateNode = Utilities.findInReactTree(Utilities.getReactInstance(node), m => m && m.getPredicateSections, {walkable: ["return", "stateNode"]}); if (stateNode) stateNode.forceUpdate(); } }; \ No newline at end of file diff --git a/renderer/src/ui/settings/addonlist.jsx b/renderer/src/ui/settings/addonlist.jsx index 75a7f73e..97bd7e59 100644 --- a/renderer/src/ui/settings/addonlist.jsx +++ b/renderer/src/ui/settings/addonlist.jsx @@ -108,7 +108,7 @@ export default class AddonList extends React.Component { } get emptyImage() { - const message = Strings.Addons.blankSlateMessage.format({link: `https://betterdiscordlibrary.com/${this.props.type}s`, type: this.props.type}).toString(); + const message = Strings.Addons.blankSlateMessage.format({link: `https://betterdiscord.app/${this.props.type}s`, type: this.props.type}).toString(); return ;