Fix Addon Error Modal crashing Discord (#1281)
This commit is contained in:
parent
4742d03ba0
commit
569a94f99f
|
@ -7,16 +7,6 @@ const combineClasses = function (...props) {
|
||||||
};
|
};
|
||||||
|
|
||||||
const DiscordClassModules = Utilities.memoizeObject({
|
const DiscordClassModules = Utilities.memoizeObject({
|
||||||
get Divider() {
|
|
||||||
const toolbar = WebpackModules.getByProps("divider", "toolbar");
|
|
||||||
const discovery = WebpackModules.getByProps("divider", "emptyGuilds");
|
|
||||||
|
|
||||||
return {
|
|
||||||
verticalDivider: toolbar.divider,
|
|
||||||
dividerLarge: discovery.divider,
|
|
||||||
divider: "bd-divider"
|
|
||||||
};
|
|
||||||
},
|
|
||||||
get Text() {
|
get Text() {
|
||||||
return combineClasses(
|
return combineClasses(
|
||||||
["size20", "size12"],
|
["size20", "size12"],
|
||||||
|
|
|
@ -47,5 +47,6 @@
|
||||||
.bd-divider {
|
.bd-divider {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 1px;
|
height: 1px;
|
||||||
border-top: thin solid hsl(0deg 0% 100% / 6%);
|
border-top: thin solid var(--background-modifier-accent);
|
||||||
|
margin-bottom: 1em;
|
||||||
}
|
}
|
|
@ -1,6 +1,7 @@
|
||||||
import {React, Strings, WebpackModules, DiscordClasses} from "modules";
|
import {React, Strings, WebpackModules, DiscordClasses} from "modules";
|
||||||
import Extension from "./icons/extension";
|
import Extension from "./icons/extension";
|
||||||
import ThemeIcon from "./icons/theme";
|
import ThemeIcon from "./icons/theme";
|
||||||
|
import Divider from "./divider";
|
||||||
|
|
||||||
const Parser = Object(WebpackModules.getByProps("defaultRules", "parse")).defaultRules;
|
const Parser = Object(WebpackModules.getByProps("defaultRules", "parse")).defaultRules;
|
||||||
|
|
||||||
|
@ -21,7 +22,7 @@ class AddonError extends React.Component {
|
||||||
const stack = err.error && err.stack;
|
const stack = err.error && err.stack;
|
||||||
if (!this.state.expanded || !stack) return null;
|
if (!this.state.expanded || !stack) return null;
|
||||||
return <div className="bd-addon-error-body">
|
return <div className="bd-addon-error-body">
|
||||||
<div className={`${DiscordClasses.Card.topDivider} ${DiscordClasses.Divider.divider}`} />
|
<Divider />
|
||||||
<div className="bd-addon-error-stack">
|
<div className="bd-addon-error-stack">
|
||||||
{Parser ? Parser.codeBlock.react({content: stack, lang: "js"}, null, {}) : stack}
|
{Parser ? Parser.codeBlock.react({content: stack, lang: "js"}, null, {}) : stack}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
import {React} from "modules";
|
||||||
|
|
||||||
|
export default ({className}) => <div className={`bd-divider ${className || ""}`}></div>;
|
|
@ -1,7 +0,0 @@
|
||||||
import {React} from "modules";
|
|
||||||
|
|
||||||
export default class Divider extends React.Component {
|
|
||||||
render() {
|
|
||||||
return <div className="bd-divider divider-3573oO marginTop8-1DLZ1n marginBottom40-2vIwTv" />;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,7 +1,7 @@
|
||||||
import Logger from "common/logger";
|
import Logger from "common/logger";
|
||||||
import {React} from "modules";
|
import {React} from "modules";
|
||||||
import Title from "./title";
|
import Title from "./title";
|
||||||
import Divider from "./divider";
|
import Divider from "../divider";
|
||||||
import Switch from "./components/switch";
|
import Switch from "./components/switch";
|
||||||
import Dropdown from "./components/dropdown";
|
import Dropdown from "./components/dropdown";
|
||||||
import Number from "./components/number";
|
import Number from "./components/number";
|
||||||
|
|
Loading…
Reference in New Issue