Compare commits

...

2 Commits

Author SHA1 Message Date
Tim Gröger a974d2d245 [pretty] prettier 2021-11-15 22:52:25 +01:00
Tim Gröger 29f1b45a3d [fix] right image loading 2021-11-15 22:51:49 +01:00
3 changed files with 7 additions and 5 deletions

View File

@ -26,7 +26,7 @@ export default defineComponent({
async function updateUser(value: FG.User) {
await userStore.updateUser(value);
user.value = value
user.value = value;
}
return {

View File

@ -4,7 +4,7 @@
<div v-if="avatar" class="col-4">
<div style="width: 100%; padding-bottom: 100%; position: relative">
<q-avatar style="position: absolute; top: 0; left: 0; width: 100%; height: 100%">
<img :src="avatarLink" :onerror="error" />
<img :src="api.defaults.baseURL + avatarLink" :onerror="error" />
</q-avatar>
</div>
</div>
@ -26,7 +26,7 @@
</template>
<script lang="ts">
import { useMainStore, useUserStore } from '@flaschengeist/api';
import { useMainStore, useUserStore, api } from '@flaschengeist/api';
import { computed, defineComponent, onMounted, ref } from 'vue';
export default defineComponent({
@ -65,7 +65,7 @@ export default defineComponent({
.filter((user) => user.userid !== mainStore.currentUser.userid)
);
return { avatar, avatarLink, error, name, hasBirthday, birthday };
return { avatar, avatarLink, error, name, hasBirthday, birthday, api };
},
});
</script>

View File

@ -139,7 +139,9 @@ export default defineComponent({
const isCurrentUser = computed(() => userModel.value.userid === mainStore.currentUser.userid);
/* Reset model if props changed */
watchEffect(() => {if(props.user.userid && props.user.userid !== userModel.value.userid) reset()})
watchEffect(() => {
if (props.user.userid && props.user.userid !== userModel.value.userid) reset();
});
function onAvatarRejected() {
Notify.create({