Page MenuHomePhorge

No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None
diff --git a/src/components/user_popover/user_popover.js b/src/components/user_popover/user_popover.js
index ab8d610721..7640c8a4ff 100644
--- a/src/components/user_popover/user_popover.js
+++ b/src/components/user_popover/user_popover.js
@@ -1,49 +1,61 @@
const UserPopover = {
name: 'UserPopover',
props: [
'userId',
'anchorOffset'
],
data () {
return {
error: false,
- fetching: false
+ fetching: false,
+ entered: false
}
},
computed: {
user () {
return this.$store.getters.findUser(this.userId)
},
relationshipAvailable () {
const relationship = this.$store.getters.relationship(this.userId)
return relationship && !relationship.loading
}
},
components: {
Popover: () => import('../popover/popover.vue'),
UserCard: () => import('../user_card/user_card.vue')
},
+ watch: {
+ userId (newValue, oldValue) {
+ if (this.entered) {
+ this.fetchUser()
+ }
+ }
+ },
methods: {
- enter () {
+ fetchUser () {
if (!this.userId) return
if (this.fetching) return
const promises = []
if (!this.user) {
promises.push(this.$store.dispatch('fetchUser', this.userId))
}
if (!this.relationshipAvailable) {
promises.push(this.$store.dispatch('fetchUserRelationship', this.userId))
}
if (promises.length > 0) {
this.fetching = true
Promise.all(promises)
.then(data => (this.error = false))
.catch(e => (this.error = true))
.finally(() => (this.fetching = false))
}
+ },
+ enter () {
+ this.entered = true
+ this.fetchUser()
}
}
}
export default UserPopover

File Metadata

Mime Type
text/x-diff
Expires
Sat, Aug 8, 2:24 AM (8 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1722821
Default Alt Text
(1 KB)

Event Timeline