@@ -4,7 +4,7 @@ import { useAccountStore, useThemeStore } from "@/scripts/store";
44import { timeAgo } from " @/scripts/time" ;
55import { UserProblem , type Profile } from " @/scripts/types" ;
66import { expandAssetUrl } from " @/scripts/utils" ;
7- import { Avatar , useToast } from " primevue" ;
7+ import { useToast } from " primevue" ;
88import { onMounted , reactive , Ref , ref , watch } from " vue" ;
99import { useRoute , useRouter } from " vue-router" ;
1010
@@ -116,6 +116,7 @@ const onSaveProfile = async ({ states }: { states: Form<Profile> }) => {
116116 return toast .add ({ severity: " error" , summary: " Error" , detail: res .message });
117117 }
118118 Object .assign (profile .value ! , data );
119+ Object .assign (accountStore .account , profile .value );
119120 editingProfile .value = false ;
120121 inProgress .value = false ;
121122 toast .add ({ severity: " success" , summary: " Profile updated" , detail: " Your profile has been updated." });
@@ -140,12 +141,15 @@ const onSaveProfile = async ({ states }: { states: Form<Profile> }) => {
140141 <div class =" w-full max-w-[1200px] flex flex-col md:flex-row my-[2em] gap-6 mx-8" >
141142 <div v-if =" !loading && profile" class =" flex flex-col h-full md:w-[18em]" >
142143 <div class =" flex w-full flex-row md:flex-col gap-4" >
143- <div class =" flex-shrink-0 w-[8em] md:w-[18em]" >
144+ <div class =" flex-shrink-0 w-[8em] md:w-[18em]"
145+ @click =" accountStore.account?.username === profile.username && router.push('/settings/profile')" >
144146 <img v-if =" profile?.avatar"
145147 class =" rounded-full border-[2px] border-zinc-300 dark:border-zinc-700"
148+ :class =" { 'cursor-pointer': accountStore.account?.username === profile.username }"
146149 :src =" expandAssetUrl(profile.avatar!)" ></img >
147150 <Avatar v-else pt:root:class =" !w-[8em] md:!w-[18em] !h-[8em] md:!h-[18em]"
148151 pt:label:class =" text-4xl md:text-9xl" :label =" (profile?.nickname ?? '?')[0]"
152+ :class =" { 'cursor-pointer': accountStore.account?.username === profile.username }"
149153 shape =" circle" class =" border-[2px] border-zinc-300 dark:border-zinc-700" >
150154 </Avatar >
151155 </div >
0 commit comments