Syncing with latest BetterDiscord commit

This commit is contained in:
Jean Ouina 2020-05-27 20:19:48 +02:00
parent be2ae143c5
commit aa401d0a9f
3 changed files with 25 additions and 2 deletions

View File

@ -392,6 +392,13 @@ export default new class V2_SettingsPanel {
render() {return this.props.children;}
}
const originalRender = ContentList.prototype.render;
Object.defineProperty(ContentList.prototype, "render", {
enumerable: false,
configurable: false,
set: function() {console.warn("Addon policy for plugins #5 https://github.com/rauenzi/BetterDiscordApp/wiki/Addon-Policies#plugins");},
get: () => originalRender
});
const list = type === "plugins" ? Object.values(bdplugins) : Object.values(bdthemes);
return BDV2.reactDom.render(BDV2.react.createElement(ContentList, {type, onChange: this.sideBarOnClick}, BDV2.react.createElement(CardList, {type, list})), this.root);
}

View File

@ -175,4 +175,12 @@ export default class CardList extends BDV2.reactComponent {
<Tools key="tools" />
</Scroller>;
}
}
}
const originalRender = CardList.prototype.render;
Object.defineProperty(CardList.prototype, "render", {
enumerable: false,
configurable: false,
set: function() {console.warn("Addon policy for plugins #5 https://github.com/rauenzi/BetterDiscordApp/wiki/Addon-Policies#plugins");},
get: () => originalRender
});

View File

@ -14,4 +14,12 @@ export default class BDErrorBoundary extends BDV2.reactComponent {
if (this.state.hasError) return BDV2.react.createElement("div", {className: "react-error"}, "Component Error");
return this.props.children;
}
}
}
const originalRender = BDErrorBoundary.prototype.render;
Object.defineProperty(BDErrorBoundary.prototype, "render", {
enumerable: false,
configurable: false,
set: function() {console.warn("Addon policy for plugins #5 https://github.com/rauenzi/BetterDiscordApp/wiki/Addon-Policies#plugins");},
get: () => originalRender
});