some stuff

This commit is contained in:
Strencher 2020-07-23 04:08:17 +02:00
parent 84be3a163b
commit 6a6fd4d559
6 changed files with 16 additions and 8 deletions

4
dist/index.js vendored

File diff suppressed because one or more lines are too long

2
dist/style.css vendored

File diff suppressed because one or more lines are too long

View File

@ -11,6 +11,6 @@ gulp.task("watch-css", function() {
function minifyCSS() {
return gulp.src("./src/styles/index.css")
.pipe(csso({restructure: false}))
.pipe(rename("style.min.css"))
.pipe(rename("style.css"))
.pipe(gulp.dest("./dist"));
}

View File

@ -1,3 +1,11 @@
/* Error Boundary stuff */
.react-error {
color: red;
font-weight: bold;
font-family: Arial, Helvetica, sans-serif;
cursor: pointer;
}
.bd-settings-group.collapsible .bd-settings-title {
display: flex;
justify-content: space-between;

View File

@ -1,17 +1,17 @@
import {React, Logger} from "modules";
import {remote} from "electron";
export default class ErrorBoundary extends React.Component {
constructor(props) {
super(props);
this.state = {hasError: false};
}
componentDidCatch() {
componentDidCatch(error, errorInfo) {
this.setState({hasError: true});
}
render() {
if (this.state.hasError) return <div className="react-error">Component Error</div>;
if (this.state.hasError) return <div onClick={() => remote.getCurrentWindow().openDevTools()} className="react-error">There was an unexpected Error. Click to open console for more details.</div>;
return this.props.children;
}
}

View File

@ -97,7 +97,7 @@ export default class AddonCard extends React.Component {
catch (err) { Logger.stacktrace("Addon Settings", "Unable to get settings panel for " + name + ".", err); }
const props = {id: `${name}-settings`, className: "addon-settings", ref: this.panelRef};
if (typeof(settingsPanel) == "string") {
if (typeof(this.settingsPanel) == "string") {
Logger.warn("Addon Settings", "Using a DOMString is officially deprecated.");
props.dangerouslySetInnerHTML = this.settingsPanel;
}