Add new thing to vue store

This commit is contained in:
Tamius Han 2020-03-15 19:14:33 +01:00
parent 72a3bba8ad
commit e9795f4a00

View File

@ -123,6 +123,7 @@ class UwUi {
return; return;
} }
try {
Vue.prototype.$browser = global.browser; Vue.prototype.$browser = global.browser;
Vue.use(Vuex); Vue.use(Vuex);
this.vuexStore = new Vuex.Store({ this.vuexStore = new Vuex.Store({
@ -130,11 +131,13 @@ class UwUi {
persistentStates: [ persistentStates: [
'uwLog', 'uwLog',
'showLogger', 'showLogger',
'loggingEnded',
], ],
})], })],
state: { state: {
uwLog: '', uwLog: '',
showLogger: false, showLogger: false,
loggingEnded: false,
}, },
mutations: { mutations: {
'uw-set-log'(state, payload) { 'uw-set-log'(state, payload) {
@ -145,6 +148,9 @@ class UwUi {
}, },
'uw-hide-logger'(state) { 'uw-hide-logger'(state) {
state['showLogger'] = false; state['showLogger'] = false;
},
'uw-logging-ended'(state) {
state['loggingEnded'] = state;
} }
}, },
actions: { actions: {
@ -156,9 +162,15 @@ class UwUi {
}, },
'uw-hide-logger'({commit}) { 'uw-hide-logger'({commit}) {
commit('uw-hide-logger'); commit('uw-hide-logger');
},
'uw-logging-ended'({commit}, payload) {
commit('uw-logging-ended', payload);
} }
} }
}); });
} catch (e) {
console.error("Ultrawidify failed to initialize vue. Error:", e);
}
// make sure we don't init twice // make sure we don't init twice
this.vueInitiated = true; this.vueInitiated = true;