Skip to content

Commit

Permalink
fix(ui): wait for $loggedUser data (#2561)
Browse files Browse the repository at this point in the history
Fixes #2556
  • Loading branch information
sogehige committed Sep 17, 2019
1 parent 130ae2b commit 218c457
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/panel/others/user.vue
@@ -1,6 +1,6 @@
<template>
<div class="ml-2 mr-2">
<b-dropdown no-caret variant="light" toggle-class="btn-sm p-0 pl-1 pr-1">
<b-dropdown no-caret variant="light" toggle-class="btn-sm p-0 pl-1 pr-1" v-if="$loggedUser">
<template v-slot:button-content>
<b-img :src="$loggedUser.profile_image_url" rounded="circle" alt="Circle image" style="width:30px;"></b-img>
{{$loggedUser.login}}
Expand Down Expand Up @@ -108,6 +108,9 @@ export default class User extends Vue {
}
refreshViewer() {
if (typeof this.$loggedUser === 'undefined') {
return setTimeout(() => this.refreshViewer(), 100);
}
this.socket.emit('findOne.viewer', { where: { id: this.$loggedUser.id }}, (err, viewer) => {
this.viewer = viewer;
this.isViewerLoaded = true;
Expand Down

0 comments on commit 218c457

Please sign in to comment.