aboutsummaryrefslogtreecommitdiff
path: root/src/modules/statuses.js
diff options
context:
space:
mode:
authorSean King <seanking2919@protonmail.com>2022-08-07 06:38:56 +0000
committerSean King <seanking2919@protonmail.com>2022-08-07 06:38:56 +0000
commit572f28d7c9efea4300cb88063baf4daab91e7910 (patch)
tree29d966a1b7141f6a768120497d3f34143f467212 /src/modules/statuses.js
parent18d69f93d38dc15a74db81ee4c10b4766bebfc35 (diff)
parent6a2f4270727913b8e5d4670b5b3bbc3f57f51ec5 (diff)
Merge branch 'fix/merge-conflicts/report-notifications' into 'feat/report-notification'
Fixing merge conflicts and lint for report notifications MR See merge request pleroma/pleroma-fe!1585
Diffstat (limited to 'src/modules/statuses.js')
-rw-r--r--src/modules/statuses.js21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/modules/statuses.js b/src/modules/statuses.js
index 66cc82bc..f8e714cf 100644
--- a/src/modules/statuses.js
+++ b/src/modules/statuses.js
@@ -245,10 +245,10 @@ const addNewStatuses = (state, { statuses, showImmediately = false, timeline, us
}
const processors = {
- 'status': (status) => {
+ status: (status) => {
addStatus(status, showImmediately)
},
- 'retweet': (status) => {
+ retweet: (status) => {
// RetweetedStatuses are never shown immediately
const retweetedStatus = addStatus(status.retweeted_status, false, false)
@@ -270,7 +270,7 @@ const addNewStatuses = (state, { statuses, showImmediately = false, timeline, us
retweet.retweeted_status = retweetedStatus
},
- 'favorite': (favorite) => {
+ favorite: (favorite) => {
// Only update if this is a new favorite.
// Ignore our own favorites because we get info about likes as response to like request
if (!state.favorites.has(favorite.id)) {
@@ -278,7 +278,7 @@ const addNewStatuses = (state, { statuses, showImmediately = false, timeline, us
favoriteStatus(favorite)
}
},
- 'deletion': (deletion) => {
+ deletion: (deletion) => {
const uri = deletion.uri
const status = find(allStatuses, { uri })
if (!status) {
@@ -292,10 +292,10 @@ const addNewStatuses = (state, { statuses, showImmediately = false, timeline, us
remove(timelineObject.visibleStatuses, { uri })
}
},
- 'follow': (follow) => {
+ follow: (follow) => {
// NOOP, it is known status but we don't do anything about it for now
},
- 'default': (unknown) => {
+ default: (unknown) => {
console.log('unknown status type')
console.log(unknown)
}
@@ -303,7 +303,7 @@ const addNewStatuses = (state, { statuses, showImmediately = false, timeline, us
each(statuses, (status) => {
const type = status.type
- const processor = processors[type] || processors['default']
+ const processor = processors[type] || processors.default
processor(status)
})
@@ -345,6 +345,7 @@ const addNewNotifications = (state, { dispatch, notifications, older, visibleNot
}
// Only add a new notification if we don't have one for the same action
+ // eslint-disable-next-line no-prototype-builtins
if (!state.notifications.idStore.hasOwnProperty(notification.id)) {
updateNotificationsMinMaxId(state, notification)
@@ -526,7 +527,7 @@ export const mutations = {
},
addEmojiReactionsBy (state, { id, emojiReactions, currentUser }) {
const status = state.allStatusesObject[id]
- status['emoji_reactions'] = emojiReactions
+ status.emoji_reactions = emojiReactions
},
addOwnReaction (state, { id, emoji, currentUser }) {
const status = state.allStatusesObject[id]
@@ -547,7 +548,7 @@ export const mutations = {
if (reactionIndex >= 0) {
status.emoji_reactions[reactionIndex] = newReaction
} else {
- status['emoji_reactions'] = [...status.emoji_reactions, newReaction]
+ status.emoji_reactions = [...status.emoji_reactions, newReaction]
}
},
removeOwnReaction (state, { id, emoji, currentUser }) {
@@ -568,7 +569,7 @@ export const mutations = {
if (newReaction.count > 0) {
status.emoji_reactions[reactionIndex] = newReaction
} else {
- status['emoji_reactions'] = status.emoji_reactions.filter(r => r.name !== emoji)
+ status.emoji_reactions = status.emoji_reactions.filter(r => r.name !== emoji)
}
},
updateStatusWithPoll (state, { id, poll }) {