257e932bc3
* vue: use our own store in place of vuex * vue store: add getters, watcher and use internal vue instance * vue store: better state getter and credits to Vuex * vue store: $watch -> watch * vuex store: pass store to getters and fix typos * add comments to store, start writing tests * fix unit tests and add missing ones * cleanup components, add less folder, fetch tassks * use Vuex helpers * pin vuex version * move semantic-ui theme to assets/less, keep website/build empty but in git * import helpers from vuex
15 lines
493 B
JavaScript
15 lines
493 B
JavaScript
export function profileName ({ state }) {
|
|
let userProfileName = state.user.profile && state.user.profile.name;
|
|
|
|
if (!userProfileName) {
|
|
if (state.user.auth.local && state.user.auth.local.username) {
|
|
userProfileName = state.user.auth.local.username;
|
|
} else if (state.user.auth.facebook) {
|
|
userProfileName = state.user.auth.facebook.displayName || state.user.auth.facebook.username;
|
|
} else {
|
|
userProfileName = 'Anonymous';
|
|
}
|
|
}
|
|
|
|
return userProfileName;
|
|
} |