Skip to content

Commit

Permalink
avatar was not reactive, see unit tests, wrapper had to be initialized (
Browse files Browse the repository at this point in the history
  • Loading branch information
Mogge authored Aug 15, 2024
1 parent 7115d0d commit 0991c91
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
3 changes: 0 additions & 3 deletions frontend/src/components/menu/UserInfo.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ describe('UserInfo', () => {
details: [],
social: [],
})
wrapper = Wrapper()
})

it('has no image and no text in avatar', () => {
Expand All @@ -86,7 +85,6 @@ describe('UserInfo', () => {
details: [],
social: [],
})
wrapper = Wrapper()
})

it('has no image but initials in avatar', () => {
Expand All @@ -108,7 +106,6 @@ describe('UserInfo', () => {
details: [],
social: [],
})
wrapper = Wrapper()
})

it('has image and not text in avatar', () => {
Expand Down
7 changes: 2 additions & 5 deletions frontend/src/components/menu/UserInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
>
<ClientOnly
><v-avatar class="avatar d-flex align-center text-font border-sm bg-primary" size="44">
<v-img v-if="userImage" :src="userImage" />
<span v-else>{{ initals?.toUpperCase() }}</span>
<v-img v-if="userStore.getCurrentUserAvatar" :src="userStore.getCurrentUserAvatar" />
<span v-else>{{ userStore.getCurrentUserInitials?.toUpperCase() }}</span>
</v-avatar>
<div class="d-flex flex-column justify-center text-right pa-1 pl-3 w-100">
<v-icon
Expand All @@ -35,9 +35,6 @@ import UserDropdown from './UserDropdown.vue'
const userStore = useUserStore()
const initals = userStore.getCurrentUserInitials
const userImage = userStore.getCurrentUserAvatar
const isOpen = ref(false)
</script>

Expand Down

0 comments on commit 0991c91

Please sign in to comment.