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) { async function updateUser(value: FG.User) {
await userStore.updateUser(value); await userStore.updateUser(value);
user.value = value user.value = value;
} }
return { return {

View File

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

View File

@ -139,7 +139,9 @@ export default defineComponent({
const isCurrentUser = computed(() => userModel.value.userid === mainStore.currentUser.userid); const isCurrentUser = computed(() => userModel.value.userid === mainStore.currentUser.userid);
/* Reset model if props changed */ /* 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() { function onAvatarRejected() {
Notify.create({ Notify.create({