@@ -4,7 +4,7 @@ import { useAccountStore, useThemeStore } from "@/scripts/store";
4
4
import { timeAgo } from " @/scripts/time" ;
5
5
import { UserProblem , type Profile } from " @/scripts/types" ;
6
6
import { expandAssetUrl } from " @/scripts/utils" ;
7
- import { Avatar , useToast } from " primevue" ;
7
+ import { useToast } from " primevue" ;
8
8
import { onMounted , reactive , Ref , ref , watch } from " vue" ;
9
9
import { useRoute , useRouter } from " vue-router" ;
10
10
@@ -116,6 +116,7 @@ const onSaveProfile = async ({ states }: { states: Form<Profile> }) => {
116
116
return toast .add ({ severity: " error" , summary: " Error" , detail: res .message });
117
117
}
118
118
Object .assign (profile .value ! , data );
119
+ Object .assign (accountStore .account , profile .value );
119
120
editingProfile .value = false ;
120
121
inProgress .value = false ;
121
122
toast .add ({ severity: " success" , summary: " Profile updated" , detail: " Your profile has been updated." });
@@ -140,12 +141,15 @@ const onSaveProfile = async ({ states }: { states: Form<Profile> }) => {
140
141
<div class =" w-full max-w-[1200px] flex flex-col md:flex-row my-[2em] gap-6 mx-8" >
141
142
<div v-if =" !loading && profile" class =" flex flex-col h-full md:w-[18em]" >
142
143
<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')" >
144
146
<img v-if =" profile?.avatar"
145
147
class =" rounded-full border-[2px] border-zinc-300 dark:border-zinc-700"
148
+ :class =" { 'cursor-pointer': accountStore.account?.username === profile.username }"
146
149
:src =" expandAssetUrl(profile.avatar!)" ></img >
147
150
<Avatar v-else pt:root:class =" !w-[8em] md:!w-[18em] !h-[8em] md:!h-[18em]"
148
151
pt:label:class =" text-4xl md:text-9xl" :label =" (profile?.nickname ?? '?')[0]"
152
+ :class =" { 'cursor-pointer': accountStore.account?.username === profile.username }"
149
153
shape =" circle" class =" border-[2px] border-zinc-300 dark:border-zinc-700" >
150
154
</Avatar >
151
155
</div >
0 commit comments