mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-01 11:37:58 +00:00
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>
This commit is contained in:
committed by
GitHub
parent
a1a81e3799
commit
99eaf59509
@@ -8,7 +8,10 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
import { mapGetters } from 'vuex';
|
||||
import WootSnackbarBox from './components/SnackbarContainer';
|
||||
import { accountIdFromPathname } from './helper/URLHelper';
|
||||
|
||||
export default {
|
||||
name: 'App',
|
||||
@@ -17,8 +20,28 @@ export default {
|
||||
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>
|
||||
|
||||
Reference in New Issue
Block a user