Skip to content

Commit

Permalink
Fix loading plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
JuliaRadzhabova committed Nov 27, 2024
1 parent fcf366c commit be49e66
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.macrosPlugin = {el: null, show: false};

Expand All @@ -124,6 +125,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 @@ -135,7 +137,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 @@ -149,7 +151,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 @@ -165,7 +168,8 @@ define([
.catch(function (err) {
me.serverPlugins.plugins = false;
});
}
} else
me.serverPlugins.plugins = false;
});
}
},
Expand Down Expand Up @@ -1007,7 +1011,8 @@ define([

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

Expand Down Expand Up @@ -1378,6 +1383,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 be49e66

Please sign in to comment.