Skip to content

Commit

Permalink
Merge pull request 'Fix loading plugins' (#153) from hotfix/v8.2.2 in…
Browse files Browse the repository at this point in the history
…to develop
  • Loading branch information
Julia Radzhabova committed Dec 2, 2024
2 parents 0ca0960 + be49e66 commit 88dca17
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions apps/common/main/lib/controller/Plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ define([

this._moveOffset = {x:0, y:0};
this.autostart = [];
this.startOnPostLoad = false;
this.customPluginsDlg = [];

this.newInstalledBackgroundPlugins = [];
Expand All @@ -123,6 +124,7 @@ define([
Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this));
Common.NotificationCenter.on('doc:mode-changed', this.onChangeDocMode.bind(this));
Common.NotificationCenter.on('modal:close', this.onModalClose.bind(this));
Common.NotificationCenter.on('script:loaded', this.onPostLoadComplete.bind(this));
},

loadConfig: function(data) {
Expand All @@ -134,7 +136,7 @@ define([

loadPlugins: function() {
this.configPlugins.plugins =
this.serverPlugins.plugins = false;
this.serverPlugins.plugins = undefined;

if (this.configPlugins.config) {
this.getPlugins(this.configPlugins.config.pluginsData)
Expand All @@ -148,7 +150,8 @@ define([

if (this.configPlugins.config.options)
this.api.setPluginsOptions(this.configPlugins.config.options);
}
} else
this.configPlugins.plugins = false;

if ( !Common.Controllers.Desktop.isActive() || !Common.Controllers.Desktop.isOffline() ) {
var server_plugins_url = '../../../../plugins.json',
Expand All @@ -164,7 +167,8 @@ define([
.catch(function (err) {
me.serverPlugins.plugins = false;
});
}
} else
me.serverPlugins.plugins = false;
});
}
},
Expand Down Expand Up @@ -989,7 +993,8 @@ define([

if (this.appOptions.canPlugins) {
this.refreshPluginsList();
this.runAutoStartPlugins();
this.startOnPostLoad = !Common.Controllers.LaunchController.isScriptLoaded();
!this.startOnPostLoad && this.runAutoStartPlugins();
}
},

Expand Down Expand Up @@ -1349,6 +1354,10 @@ define([
}
},

onPostLoadComplete: function() {
this.startOnPostLoad && this.runAutoStartPlugins();
},

textRunPlugin: 'Run plugin',
textRunInstalledPlugins: 'Run installed plugins',
textPluginSuccessfullyInstalled: '<b>{0}</b> is successfully installed. You can access all background plugins here.',
Expand Down

0 comments on commit 88dca17

Please sign in to comment.