Fixed bug where CSS editor cannot be opened twice without restarting

Uncaught exception:
 Error: Object has been destroyed
    at CSSEditor.openEditor (/Users/Samuel/Documents/BetterDiscord/2018-01-19/betterdiscordapp/core/dist/modules/csseditor.js:21:40)
This commit is contained in:
Samuel Elliott 2018-01-22 00:20:15 +00:00
parent 731d18e4da
commit 10ea33f270
1 changed files with 3 additions and 3 deletions

View File

@ -16,9 +16,9 @@ const { Module } = require('./modulebase');
class CSSEditor extends Module {
openEditor(o) {
if (this.editor && this.editor.isFocused()) return;
if (this.editor) {
if (this.editor.isFocused()) return;
if (this.editor && this.editor.open) {
this.editor.focus();
this.editor.flashFrame(true);
o.reply(true);
@ -31,7 +31,7 @@ class CSSEditor extends Module {
this.editor.setSheetOffset(33);
this.editor.webContents.on('close', () => {
this.editor.open = false;
this.editor = null;
});
this.editor.webContents.on('did-finish-load', () => {