Fix issue with loading new version plugins in the web app

Attempt to fix plugin settings deleting in rare cases
This commit is contained in:
JannisX11 2023-08-15 12:17:47 +02:00
parent b7ce88e2da
commit 7157dcad89
2 changed files with 9 additions and 1 deletions

View File

@ -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);

View File

@ -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) {