aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2019-03-14 23:04:13 +0200
committerHenry Jameson <me@hjkos.com>2019-03-14 23:07:28 +0200
commit6420c93e983040807ea58277e5780038a656ef4d (patch)
tree06f6964c22fe40762e80dd0ead7cb4588489f119 /src
parent885a3a77df84c21026b7d13ff368c3bebcf70561 (diff)
fix flake id users not fetching correctly
Diffstat (limited to 'src')
-rw-r--r--src/components/user_profile/user_profile.js3
-rw-r--r--src/modules/users.js9
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 1bf4a86d..82df4510 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 2d23955b..fafe1a60 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 = {