mirror of
https://git.notfire.cc/notfire/akkoma-fe.git
synced 2026-01-11 05:23:16 -08:00
add additional memo check for going to an already loaded user
This commit is contained in:
parent
693bd0c7a5
commit
a477547c80
1 changed files with 7 additions and 1 deletions
|
|
@ -145,13 +145,19 @@ const UserProfile = {
|
||||||
if (user) {
|
if (user) {
|
||||||
loadById(user.id)
|
loadById(user.id)
|
||||||
this.note = user?.relationship?.note
|
this.note = user?.relationship?.note
|
||||||
|
if (this.note === undefined) {
|
||||||
|
this.$store.dispatch('fetchUserRelationshipNote', user.id)
|
||||||
|
.then((resp) => {
|
||||||
|
this.note = resp
|
||||||
|
})
|
||||||
|
}
|
||||||
this.$store.dispatch('setDisplayBackground', user.background_image)
|
this.$store.dispatch('setDisplayBackground', user.background_image)
|
||||||
} else {
|
} else {
|
||||||
this.$store.dispatch('fetchUser', userNameOrId)
|
this.$store.dispatch('fetchUser', userNameOrId)
|
||||||
.then(({ id, relationship, background_image }) => {
|
.then(({ id, relationship, background_image }) => {
|
||||||
this.note = relationship?.note
|
this.note = relationship?.note
|
||||||
if (this.note === undefined) {
|
if (this.note === undefined) {
|
||||||
this.$store.dispatch('fetchUserRelationshipNote', userNameOrId)
|
this.$store.dispatch('fetchUserRelationshipNote', user.id)
|
||||||
.then((resp) => {
|
.then((resp) => {
|
||||||
this.note = resp
|
this.note = resp
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue