From 80a7035154ccd4ccf9f761d4117f286e352676e9 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Thu, 17 Jan 2019 23:08:44 +0300 Subject: [PATCH] removing unnecessary conversions since it should already be converted in normalizer --- src/components/conversation-page/conversation-page.js | 2 +- src/components/conversation/conversation.js | 7 ++++--- src/modules/statuses.js | 5 +---- src/modules/users.js | 2 +- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/components/conversation-page/conversation-page.js b/src/components/conversation-page/conversation-page.js index bdf84d0c..8f1ac3d9 100644 --- a/src/components/conversation-page/conversation-page.js +++ b/src/components/conversation-page/conversation-page.js @@ -7,7 +7,7 @@ const conversationPage = { }, computed: { statusoid () { - const id = String(this.$route.params.id) + const id = this.$route.params.id const statuses = this.$store.state.statuses.allStatuses const status = find(statuses, {id}) diff --git a/src/components/conversation/conversation.js b/src/components/conversation/conversation.js index 237de7e5..9bf5e136 100644 --- a/src/components/conversation/conversation.js +++ b/src/components/conversation/conversation.js @@ -33,7 +33,9 @@ const conversation = { replies () { let i = 1 return reduce(this.conversation, (result, {id, in_reply_to_status_id}) => { - const irid = String(in_reply_to_status_id) + /* eslint-disable camelcase */ + const irid = in_reply_to_status_id + /* eslint-enable camelcase */ if (irid) { result[irid] = result[irid] || [] result[irid].push({ @@ -70,7 +72,6 @@ const conversation = { } }, getReplies (id) { - id = String(id) return this.replies[id] || [] }, focused (id) { @@ -81,7 +82,7 @@ const conversation = { } }, setHighlight (id) { - this.highlight = String(id) + this.highlight = id } } } diff --git a/src/modules/statuses.js b/src/modules/statuses.js index f976fa42..83cf7256 100644 --- a/src/modules/statuses.js +++ b/src/modules/statuses.js @@ -64,9 +64,6 @@ const visibleNotificationTypes = (rootState) => { } const mergeOrAdd = (arr, obj, item) => { - // For sequential IDs BE passes numbers as numbers, we want them as strings. - item.id = String(item.id) - const oldItem = obj[item.id] if (oldItem) { @@ -164,7 +161,7 @@ const addNewStatuses = (state, { statuses, showImmediately = false, timeline, us } const favoriteStatus = (favorite, counter) => { - const status = find(allStatuses, { id: String(favorite.in_reply_to_status_id) }) + const status = find(allStatuses, { id: favorite.in_reply_to_status_id }) if (status) { // This is our favorite, so the relevant bit. if (favorite.user.id === user.id) { diff --git a/src/modules/users.js b/src/modules/users.js index 0b55d701..d83f0dd8 100644 --- a/src/modules/users.js +++ b/src/modules/users.js @@ -151,7 +151,7 @@ const users = { }, addNewNotifications (store, { notifications }) { const users = map(notifications, 'from_profile') - const notificationIds = notifications.map(_ => String(_.id)) + const notificationIds = notifications.map(_ => _.id) store.commit('addNewUsers', users) const notificationsObject = store.rootState.statuses.notifications.idStore