From 7157dcad896b992d47eeb0e28dde36bf2f3c0dbd Mon Sep 17 00:00:00 2001 From: JannisX11 Date: Tue, 15 Aug 2023 12:17:47 +0200 Subject: [PATCH] Fix issue with loading new version plugins in the web app Attempt to fix plugin settings deleting in rare cases --- js/interface/settings.js | 4 ++++ js/plugin_loader.js | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/js/interface/settings.js b/js/interface/settings.js index f207a3fd..89b74a2b 100644 --- a/js/interface/settings.js +++ b/js/interface/settings.js @@ -72,6 +72,10 @@ class Setting { if (!this.icon) this.icon = 'settings'; } this.keybind_label = tl('data.setting'); + + if (Blockbench.setup_successful) { + Settings.saveLocalStorages(); + } } get value() { let profile = SettingsProfile.all.find(profile => profile.isActive() && profile.settings[this.id] !== undefined); diff --git a/js/plugin_loader.js b/js/plugin_loader.js index ffc68e6c..71f558e8 100644 --- a/js/plugin_loader.js +++ b/js/plugin_loader.js @@ -99,7 +99,11 @@ class Plugin { var scope = this; Plugins.registered[this.id] = this; return await new Promise((resolve, reject) => { - $.getScript(Plugins.path + scope.id + '.js', () => { + let path = Plugins.path + scope.id + '.js'; + if (!isApp && this.new_repository_format) { + path = `${Plugins.path}${scope.id}/${scope.id}.js`; + } + $.getScript(path, () => { if (cb) cb.bind(scope)() scope.bindGlobalData(first) if (first && scope.oninstall) {