aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2019-03-11 02:17:49 +0200
committerHenry Jameson <me@hjkos.com>2019-03-11 02:17:58 +0200
commit06d39b62a8358c911b18f5acc378047035840465 (patch)
tree1d0179149d090929eec55125754b0f890b0889cc /src
parent489f840d84b0057cf9ddddcb8dc594bfc5ad628f (diff)
fixed tests, review fixes, now storing local users with downcase screen name for
better compatibility
Diffstat (limited to 'src')
-rw-r--r--src/components/user_profile/user_profile.js7
-rw-r--r--src/modules/statuses.js2
-rw-r--r--src/modules/users.js4
3 files changed, 7 insertions, 6 deletions
diff --git a/src/components/user_profile/user_profile.js b/src/components/user_profile/user_profile.js
index 2d186bc5..a8dfce2f 100644
--- a/src/components/user_profile/user_profile.js
+++ b/src/components/user_profile/user_profile.js
@@ -68,7 +68,7 @@ const UserProfile = {
},
userInStore () {
const routeParams = this.$route.params
- return this.$store.getters.findUser(routeParams.name || routeParams.iid)
+ return this.$store.getters.findUser(routeParams.name || routeParams.id)
},
user () {
if (this.timeline.statuses[0]) {
@@ -135,13 +135,14 @@ const UserProfile = {
}
},
watch: {
- userId (newVal, oldVal) {
+ // userId can be undefined if we don't know it yet
+ userId (newVal) {
if (newVal) {
this.cleanUp()
this.startUp()
}
},
- userName (newVal, oldVal) {
+ userName () {
if (this.$route.params.name) {
this.fetchUserId()
this.cleanUp()
diff --git a/src/modules/statuses.js b/src/modules/statuses.js
index 2b0215f0..ea1b2de0 100644
--- a/src/modules/statuses.js
+++ b/src/modules/statuses.js
@@ -73,7 +73,7 @@ const mergeOrAdd = (arr, obj, item) => {
if (oldItem) {
// We already have this, so only merge the new info.
// We ignore null values to avoid overwriting existing properties with missing data
- // we also skip 'used' because that is handled by users module
+ // we also skip 'user' because that is handled by users module
merge(oldItem, omitBy(item, (v, k) => v === null || k === 'user'))
// Reactivity fix.
oldItem.attachments.splice(oldItem.attachments.length)
diff --git a/src/modules/users.js b/src/modules/users.js
index e4146c31..5eabb1ec 100644
--- a/src/modules/users.js
+++ b/src/modules/users.js
@@ -18,7 +18,7 @@ export const mergeOrAdd = (arr, obj, item) => {
arr.push(item)
obj[item.id] = item
if (item.screen_name && !item.screen_name.includes('@')) {
- obj[item.screen_name] = item
+ obj[item.screen_name.toLowerCase()] = item
}
return { item, new: true }
}
@@ -132,7 +132,7 @@ export const mutations = {
}
export const getters = {
- findUser: state => query => state.usersObject[query]
+ findUser: state => query => state.usersObject[typeof query === 'string' ? query.toLowerCase() : query]
}
export const defaultState = {