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:
Nithin David Thomas
2020-04-06 22:17:07 +05:30
committed by GitHub
parent a1a81e3799
commit 99eaf59509
48 changed files with 1385 additions and 67 deletions

View File

@@ -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>