From 30e937d5d49d8587e0013696498498cf5114683f Mon Sep 17 00:00:00 2001 From: Mirco Wittrien Date: Mon, 27 Sep 2021 21:41:48 +0200 Subject: [PATCH] stuff --- Library/0BDFDB.plugin.js | 27 +++++++++++-------- Plugins/ServerFolders/ServerFolders.plugin.js | 2 +- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/Library/0BDFDB.plugin.js b/Library/0BDFDB.plugin.js index 4bcdd25a21..6a7540c49f 100644 --- a/Library/0BDFDB.plugin.js +++ b/Library/0BDFDB.plugin.js @@ -148,16 +148,21 @@ module.exports = (_ => { } } stop () { - if (this.stopping) return; - this.stopping = true; - BDFDB.TimeUtils.timeout(_ => {delete this.stopping;}); - - BDFDB.TimeUtils.suppress(_ => { - if (typeof this.onStop == "function") this.onStop(); - BDFDB.PluginUtils.clear(this); - }, "Failed to stop Plugin!", config.info)(); + if (window.BDFDB_Global.loading) { + if (PluginStores.delayed.starts.includes(this)) PluginStores.delayed.starts.splice(PluginStores.delayed.starts.indexOf(this), 1); + } + else { + if (this.stopping) return; + this.stopping = true; + BDFDB.TimeUtils.timeout(_ => {delete this.stopping;}); + + BDFDB.TimeUtils.suppress(_ => { + if (typeof this.onStop == "function") this.onStop(); + BDFDB.PluginUtils.clear(this); + }, "Failed to stop Plugin!", config.info)(); - delete this.started; + delete this.started; + } } }; }; @@ -6567,8 +6572,8 @@ module.exports = (_ => { BDFDB.ReactUtils.createElement(InternalComponents.LibraryComponents.TextInput, BDFDB.ObjectUtils.exclude(Object.assign({}, this.props, { className: BDFDB.disCN.inputmultilast, inputClassName: BDFDB.disCN.inputmultifield, - onFocus: e => {this.setState({focused: true})}, - onBlur: e => {this.setState({focused: false})} + onFocus: e => this.setState({focused: true}), + onBlur: e => this.setState({focused: false}) }), "children", "innerClassName")) ] }) diff --git a/Plugins/ServerFolders/ServerFolders.plugin.js b/Plugins/ServerFolders/ServerFolders.plugin.js index 7cb2a875c2..464ee851ca 100644 --- a/Plugins/ServerFolders/ServerFolders.plugin.js +++ b/Plugins/ServerFolders/ServerFolders.plugin.js @@ -497,7 +497,7 @@ module.exports = (_ => { } onSwitch () { - if (typeof BDFDB === "object" && this.settings.general.forceOpenFolder) { + if (typeof BDFDB === "object" && BDFDB.loaded && this.settings.general.forceOpenFolder) { let folder = BDFDB.GuildUtils.getFolder(BDFDB.LibraryModules.LastGuildStore.getGuildId()); if (folder && !BDFDB.LibraryModules.FolderUtils.isFolderExpanded(folder.folderId)) BDFDB.LibraryModules.GuildUtils.toggleGuildFolderExpand(folder.folderId); }