Move timezone configuration to App component

This commit is contained in:
Matthias 2021-07-01 20:19:51 +02:00
parent 9f985b6070
commit 3db97c07ad
2 changed files with 12 additions and 5 deletions

View File

@ -9,11 +9,22 @@
import { Component, Vue } from 'vue-property-decorator';
import Header from '@/components/layout/Header.vue';
import Body from '@/components/layout/Body.vue';
import { namespace } from 'vuex-class';
import { SettingsGetters } from './store/modules/settings';
import { setTimezone } from './shared/formatters';
const uiSettingsNs = namespace('uiSettings');
@Component({
components: { Header, Body },
})
export default class App extends Vue {}
export default class App extends Vue {
@uiSettingsNs.Getter [SettingsGetters.timezone]: string;
mounted() {
setTimezone(this.timezone);
}
}
</script>
<style scoped>

View File

@ -58,7 +58,6 @@ import { LayoutActions, LayoutGetters } from '@/store/modules/layout';
import { BotStoreGetters } from '@/store/modules/ftbot';
import Favico from 'favico.js';
import { OpenTradeVizOptions, SettingsGetters } from '@/store/modules/settings';
import { setTimezone } from '@/shared/formatters';
const ftbot = namespace('ftbot');
const layoutNs = namespace('layout');
@ -96,8 +95,6 @@ export default class NavBar extends Vue {
@uiSettingsNs.Getter [SettingsGetters.openTradesInTitle]: string;
@uiSettingsNs.Getter [SettingsGetters.timezone]: string;
favicon: Favico | undefined = undefined;
mounted() {
@ -108,7 +105,6 @@ export default class NavBar extends Vue {
// Query botstate - this will enable / disable certain modes
this.getState();
}
setTimezone(this.timezone);
}
beforeDestroy() {