Chatwoot/app/javascript/dashboard/App.vue
Nithin David Thomas 99eaf59509
Feature: Ability to set an account name (#667)
* Ability to change the account name 
* Ability to set a language to the account

Addresses: #667  #307  

Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
2020-04-06 22:17:07 +05:30

53 lines
1.1 KiB
Vue

<template>
<div id="app" class="app-wrapper app-root">
<transition name="fade" mode="out-in">
<router-view></router-view>
</transition>
<woot-snackbar-box />
</div>
</template>
<script>
import Vue from 'vue';
import { mapGetters } from 'vuex';
import WootSnackbarBox from './components/SnackbarContainer';
import { accountIdFromPathname } from './helper/URLHelper';
export default {
name: 'App',
components: {
WootSnackbarBox,
},
computed: {
...mapGetters({
getAccount: 'accounts/getAccount',
}),
},
mounted() {
this.$store.dispatch('setUser');
this.initializeAccount();
},
methods: {
async initializeAccount() {
const { pathname } = window.location;
const accountId = accountIdFromPathname(pathname);
if (accountId) {
await this.$store.dispatch('accounts/get');
const { locale } = this.getAccount(accountId);
Vue.config.lang = locale;
}
},
},
};
</script>
<style lang="scss">
@import './assets/scss/app';
</style>
<style src="vue-multiselect/dist/vue-multiselect.min.css"></style>