add additional memo check for going to an already loaded user

This commit is contained in:
notfire 2026-01-04 15:14:19 -05:00
commit a477547c80
No known key found for this signature in database

View file

@ -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
}) })