pull/3094/head
Grandschtroumpf 6 years ago committed by yann300
parent 7bd41c17c5
commit 7618fc145c
  1. 8
      src/app/components/local-plugin.js
  2. 1
      src/app/components/plugin-manager-component.js

@ -3,8 +3,6 @@ const modalDialog = require('../ui/modaldialog')
module.exports = class LocalPlugin {
constructor() {}
/**
* Open a modal to create a local plugin
* @param {{profile: any, api: any}[]} plugins The list of the plugins in the store
@ -12,10 +10,10 @@ module.exports = class LocalPlugin {
*/
open (plugins) {
this.profile = JSON.parse(localStorage.getItem('plugins/local')) || { notifications: {} }
return new Promise((res, rej) => {
return new Promise((resolve, reject) => {
modalDialog('Local Plugin', this.form(plugins),
{ fn:() => res(this.create()) },
{ fn: () => rej() }
{ fn: () => resolve(this.create()) },
{ fn: () => resolve() }
)
})
}

@ -105,6 +105,7 @@ class PluginManagerComponent {
*/
async openLocalPlugin () {
const profile = await this.localPlugin.open(this.store.getAll())
if (!profile) return
const resolveLocaton = (iframe) => this.appManager.resolveLocation(profile, iframe)
const api = new Plugin(profile, { resolveLocaton })
this.appManager.init([{profile, api}])

Loading…
Cancel
Save