removing unnecessary conversions since it should already be converted in normalizer

This commit is contained in:
Henry Jameson 2019-01-17 23:08:44 +03:00
parent 8172eeb1e0
commit 80a7035154
4 changed files with 7 additions and 9 deletions

View file

@ -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})

View file

@ -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
}
}
}

View file

@ -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) {

View file

@ -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