diff --git a/src/atlasViewer/atlasViewer.pluginService.service.ts b/src/atlasViewer/atlasViewer.pluginService.service.ts index 0ad03718bd285ce3d53cb48cb99ce06707269619..07be6886bcf492d20dd177077e5e54e896b46f1c 100644 --- a/src/atlasViewer/atlasViewer.pluginService.service.ts +++ b/src/atlasViewer/atlasViewer.pluginService.service.ts @@ -32,13 +32,7 @@ export class PluginServices{ ){ this.pluginUnitFactory = this.cfr.resolveComponentFactory( PluginUnit ) - this.apiService.interactiveViewer.uiHandle.launchNewWidget = (manifest) => this.launchPlugin(manifest) - .then(handler => { - this.orphanPlugins.add(manifest) - handler.onShutdown(() => { - this.orphanPlugins.delete(manifest) - }) - }) + this.apiService.interactiveViewer.uiHandle.launchNewWidget = this.launchNewWidget.bind(this) this.atlasDataService.promiseFetchedPluginManifests @@ -47,6 +41,14 @@ export class PluginServices{ .catch(console.error) } + launchNewWidget = (manifest) => this.launchPlugin(manifest) + .then(handler => { + this.orphanPlugins.add(manifest) + handler.onShutdown(() => { + this.orphanPlugins.delete(manifest) + }) + }) + readyPlugin(plugin:PluginManifest):Promise<any>{ return Promise.all([ isDefined(plugin.template) ? diff --git a/src/atlasViewer/atlasViewer.urlService.service.ts b/src/atlasViewer/atlasViewer.urlService.service.ts index 7d95d349e7f31115773417278ae9786bce632c60..c707eb3c7a63a345ec5ab435d262e2278201503f 100644 --- a/src/atlasViewer/atlasViewer.urlService.service.ts +++ b/src/atlasViewer/atlasViewer.urlService.service.ts @@ -182,7 +182,7 @@ export class AtlasViewerURLService{ const pluginStates = searchparams.get('pluginStates') if(pluginStates){ const arrPluginStates = pluginStates.split('__') - arrPluginStates.forEach(url => fetch(url).then(res => res.json()).then(json => this.pluginService.launchPlugin(json)).catch(console.error)) + arrPluginStates.forEach(url => fetch(url).then(res => res.json()).then(json => this.pluginService.launchNewWidget(json)).catch(console.error)) } })