mirror of
https://github.com/Spythere/genera-tor.git
synced 2026-05-02 21:18:12 +00:00
hotfix: global states refresh
This commit is contained in:
+14
-1
@@ -20,19 +20,32 @@
|
||||
import { useRegisterSW } from 'virtual:pwa-register/vue';
|
||||
import { defineComponent } from 'vue';
|
||||
import packageInfo from '../package.json';
|
||||
import { useStore } from './store/store';
|
||||
import orderStorageMixin from './mixins/orderStorageMixin';
|
||||
|
||||
export default defineComponent({
|
||||
mixins: [orderStorageMixin],
|
||||
|
||||
setup() {
|
||||
const { offlineReady, needRefresh, updateServiceWorker } = useRegisterSW({ immediate: true });
|
||||
|
||||
return { offlineReady, needRefresh, updateServiceWorker };
|
||||
},
|
||||
data() {
|
||||
return { appVersion: packageInfo.version };
|
||||
return { appVersion: packageInfo.version, store: useStore() };
|
||||
},
|
||||
|
||||
created() {
|
||||
document.title = `GeneraTOR ${this.appVersion}`;
|
||||
this.store.orderDarkMode = this.getOrderSetting('dark-mode') === 'true';
|
||||
|
||||
const query = new URLSearchParams(window.location.search);
|
||||
|
||||
const id = query.get('sceneryId');
|
||||
|
||||
if (id != null) {
|
||||
this.store.orderMode = 'OrderTrainPicker';
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
/>
|
||||
<span>Aktualizuj numer rozkazu po skopiowaniu</span>
|
||||
</label>
|
||||
|
||||
|
||||
<label for="save-increment" class="g-checkbox">
|
||||
<input
|
||||
type="checkbox"
|
||||
@@ -111,8 +111,6 @@ export default defineComponent({
|
||||
this.incrementOnSave = this.getOrderSetting('save-increment') === 'true';
|
||||
this.incrementOnCopy = this.getOrderSetting('copy-increment') === 'true';
|
||||
this.updateDate = this.getOrderSetting('update-date') === 'true';
|
||||
|
||||
this.store.orderDarkMode = this.getOrderSetting('dark-mode') === 'true';
|
||||
},
|
||||
|
||||
computed: {
|
||||
|
||||
@@ -77,16 +77,6 @@ export default defineComponent({
|
||||
};
|
||||
},
|
||||
|
||||
created() {
|
||||
const query = new URLSearchParams(window.location.search);
|
||||
|
||||
const id = query.get('sceneryId');
|
||||
|
||||
if (id != null) {
|
||||
this.store.orderMode = 'OrderTrainPicker';
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
orderModeComponent() {
|
||||
switch (this.store.orderMode) {
|
||||
|
||||
Reference in New Issue
Block a user