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;
}
try {
Vue.prototype.$browser = global.browser;
Vue.use(Vuex);
this.vuexStore = new Vuex.Store({
@ -130,11 +131,13 @@ class UwUi {
persistentStates: [
'uwLog',
'showLogger',
'loggingEnded',
],
})],
state: {
uwLog: '',
showLogger: false,
loggingEnded: false,
},
mutations: {
'uw-set-log'(state, payload) {
@ -145,6 +148,9 @@ class UwUi {
},
'uw-hide-logger'(state) {
state['showLogger'] = false;
},
'uw-logging-ended'(state) {
state['loggingEnded'] = state;
}
},
actions: {
@ -156,9 +162,15 @@ class UwUi {
},
'uw-hide-logger'({commit}) {
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
this.vueInitiated = true;