refactor: update user image handling and disabled profile menu options

This commit is contained in:
puriphatt 2024-12-26 11:58:07 +07:00
parent 7b78c95292
commit 7faef797cc
2 changed files with 31 additions and 28 deletions

View file

@ -16,10 +16,10 @@ import useMyBranchStore from 'stores/my-branch';
import { useConfigStore } from 'src/stores/config';
import { useNavigator } from 'src/stores/navigator';
import { initLang, initTheme, Lang, setLang } from 'src/utils/ui';
import { baseUrl } from 'stores/utils';
const useMyBranch = useMyBranchStore();
const { fetchListMyBranch } = useMyBranch;
const apiBaseUrl = import.meta.env.VITE_API_BASE_URL;
interface NotificationButton {
item: string;
@ -141,11 +141,10 @@ onMounted(async () => {
if (user === 'admin') return;
if (uid) {
userImage.value = `${apiBaseUrl}/user/${uid}/image`;
const res = await userStore.fetchById(uid);
if (res && res.gender) {
userGender.value = res.gender;
userImage.value = `${baseUrl}/user/${uid}/profile-image/${res.selectedImage}`;
}
}
});
@ -276,7 +275,7 @@ onMounted(async () => {
<div class="row q-gutter-x-md items-center" style="margin-left: auto">
<!-- notification -->
<q-btn
<!-- <q-btn
round
dense
flat
@ -345,7 +344,7 @@ onMounted(async () => {
</span>
</div>
<span align="right" class="col text-caption text-stone">
<!-- {{ moment(item.createdAt).fromNow() }} -->
{{ moment(item.createdAt).fromNow() }}
5 s
</span>
<q-tooltip
@ -358,17 +357,17 @@ onMounted(async () => {
</q-tooltip>
</q-item>
</div>
<!-- <template v-slot:loading>
<div
class="text-center q-my-md"
v-if="noti && noti?.result.length < noti?.total"
>
<q-spinner-dots color="primary" size="40px" />
</div>
</template> -->
<template v-slot:loading>
<div
class="text-center q-my-md"
v-if="noti && noti?.result.length < noti?.total"
>
<q-spinner-dots color="primary" size="40px" />
</div>
</template>
</q-infinite-scroll>
</q-menu>
</q-btn>
</q-btn> -->
<!-- เปลนนภาษา -->
<q-btn