From 885a3a77df84c21026b7d13ff368c3bebcf70561 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Thu, 14 Mar 2019 18:50:51 +0200 Subject: [PATCH 1/3] fix console error --- src/modules/users.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/modules/users.js b/src/modules/users.js index 271146844..2d23955b5 100644 --- a/src/modules/users.js +++ b/src/modules/users.js @@ -94,11 +94,12 @@ export const mutations = { updateUserRelationship (state, relationships) { relationships.forEach((relationship) => { const user = state.usersObject[relationship.id] - - user.follows_you = relationship.followed_by - user.following = relationship.following - user.muted = relationship.muting - user.statusnet_blocking = relationship.blocking + if (user) { + user.follows_you = relationship.followed_by + user.following = relationship.following + user.muted = relationship.muting + user.statusnet_blocking = relationship.blocking + } }) }, saveBlocks (state, blockIds) { From 6420c93e983040807ea58277e5780038a656ef4d Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Thu, 14 Mar 2019 23:04:13 +0200 Subject: [PATCH 2/3] fix flake id users not fetching correctly --- src/components/user_profile/user_profile.js | 3 ++- src/modules/users.js | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/components/user_profile/user_profile.js b/src/components/user_profile/user_profile.js index 1bf4a86d2..82df4510f 100644 --- a/src/components/user_profile/user_profile.js +++ b/src/components/user_profile/user_profile.js @@ -68,7 +68,8 @@ const UserProfile = { }, userInStore () { const routeParams = this.$route.params - return this.$store.getters.findUser(routeParams.name || routeParams.id) + // This needs fetchedUserId so that computed will be refreshed when user is fetched + return this.$store.getters.findUser(this.fetchedUserId || routeParams.name || routeParams.id) }, user () { if (this.timeline.statuses[0]) { diff --git a/src/modules/users.js b/src/modules/users.js index 2d23955b5..fafe1a609 100644 --- a/src/modules/users.js +++ b/src/modules/users.js @@ -133,7 +133,14 @@ export const mutations = { } export const getters = { - findUser: state => query => state.usersObject[typeof query === 'string' ? query.toLowerCase() : query] + findUser: state => query => { + const result = state.usersObject[query] + // In case it's a screen_name, we can try searching case-insensitive + if (!result && typeof query === 'string') { + return state.usersObject[query.toLowerCase()] + } + return result + } } export const defaultState = { From 71c12fa3a58ff2b498ed5ba9d3fc3d58d016bd97 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Thu, 14 Mar 2019 23:04:30 +0200 Subject: [PATCH 3/3] fix user-card avatar falling into permament failed state --- src/components/user_avatar/user_avatar.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/components/user_avatar/user_avatar.js b/src/components/user_avatar/user_avatar.js index e513b9935..e6fed3b59 100644 --- a/src/components/user_avatar/user_avatar.js +++ b/src/components/user_avatar/user_avatar.js @@ -23,6 +23,11 @@ const UserAvatar = { imageLoadError () { this.showPlaceholder = true } + }, + watch: { + src () { + this.showPlaceholder = false + } } }