Skip to content

Commit

Permalink
fixed update notification not appearing
Browse files Browse the repository at this point in the history
  • Loading branch information
solvedDev committed Aug 6, 2019
1 parent 77d613f commit be22915
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/renderer/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
},
created() {
SETTINGS.setup();
new UpdateWindow();
},
computed: {
is_sidebar_open() {
Expand Down
10 changes: 6 additions & 4 deletions src/renderer/scripts/plugins/Bridge.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,21 +233,23 @@ export default class Bridge {
this.Window = {
register(window) {
if(window.id === undefined) throw new Error("No window id defined.");
Store.commit("addPluginWindow", window);
Store.commit("addPluginWindow", { ...window, is_plugin: true });
},
update(window) {
Store.commit("updatePluginWindow", window);
Store.commit("updatePluginWindow", { ...window, is_plugin: true });
},
open(id) {
Store.commit("setWindowIsVisible", {
id,
val: true
val: true,
is_plugin: true
});
},
close(id) {
Store.commit("setWindowIsVisible", {
id,
val: false
val: false,
is_plugin: true
});
},
remove(id) {
Expand Down
6 changes: 3 additions & 3 deletions src/renderer/store/modules/WindowFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const mutations = {
}

if(i === state.elements.length) state.elements.push(detachObj({}, window));
else if(id) throw new Error("Unknown window ID: " + id);
else if(window.id) throw new Error("Unknown window ID: " + window.id);

},
updatePluginWindow(state, window) {
Expand All @@ -36,7 +36,7 @@ const mutations = {
let tmp = detachObj(state.elements[i], window);
Vue.set(state.elements, i, tmp);
}
else if(id) throw new Error("Unknown window ID: " + id);
else if(window.id) throw new Error("Unknown window ID: " + window.id);
},
removePluginWindow(state, id) {
let i = 0;
Expand All @@ -55,7 +55,7 @@ const mutations = {
if(state.elements.length > index && state.elements[index].id === id) state.elements.splice(index, 1);
},
resetPluginWindows(state) {
state.elements = [];
state.elements = state.elements.filter(w => !w.is_plugin);
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/renderer/windows/UpdateApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export default class UpdateWindow extends ContentWindow {
fetch(WEB_APP_DATA + "app.json")
.then(data => data.json())
.then(web_data => {
console.log(`Running bridge. ${APP_VERSION} | Latest: ${web_data.latest_version}`);
if(VERSION_UTILS.lessThan(APP_VERSION, web_data.latest_version)) {
this.content[4].text = `\n${web_data.latest_version} of bridge. is now available for download. Updates deliver new features for this editor and may include important bug fixes.\n\nPlease take the time to update bridge.!\n\n`;
this.update({ is_visible: true, content: this.content });
Expand Down Expand Up @@ -71,6 +72,6 @@ export default class UpdateWindow extends ContentWindow {
text: ""
}
];
this.update({ content: this.content })
this.update({ content: this.content });
}
}

0 comments on commit be22915

Please sign in to comment.