diff --git a/frontend/src/common/config.js b/frontend/src/common/config.js index 863258163..e0e9c1edb 100644 --- a/frontend/src/common/config.js +++ b/frontend/src/common/config.js @@ -1,4 +1,4 @@ -import Api from "common/api"; +import Event from "pubsub-js"; class Config { /** @@ -11,15 +11,14 @@ class Config { this.values = values; - // this.setValues(JSON.parse(this.storage.getItem(this.storage_key))); - // this.setValues(values); + this.subscriptionId = Event.subscribe('config.updated', (ev, data) => this.setValues(data)); } setValues(values) { - if(!values) return; + if (!values) return; - for(let key in values) { - if(values.hasOwnProperty(key)) { + for (let key in values) { + if (values.hasOwnProperty(key)) { this.setValue(key, values[key]); } } @@ -52,14 +51,6 @@ class Config { return this; } - - pullFromServer() { - return Api.get("config").then( - (result) => { - this.setValues(result.data); - } - ); - } } export default Config; diff --git a/frontend/src/pages/library/import.vue b/frontend/src/pages/library/import.vue index 04d296341..b941956e0 100644 --- a/frontend/src/pages/library/import.vue +++ b/frontend/src/pages/library/import.vue @@ -27,6 +27,7 @@