aboutsummaryrefslogtreecommitdiff
path: root/src/modules/statuses.js
diff options
context:
space:
mode:
authorWyatt Benno <wyattbenno@gmail.com>2019-06-21 10:31:00 +0900
committerWyatt Benno <wyattbenno@gmail.com>2019-06-21 10:31:00 +0900
commita1c50c3fc1a8613c0c6dec9d366808a32b09bda4 (patch)
tree14def04d6b3aea89f627d9a476e0a7ae5e09768e /src/modules/statuses.js
parent752ee9d70c48050fc9fe5da5501773b24fc597fc (diff)
fix for #553
Diffstat (limited to 'src/modules/statuses.js')
-rw-r--r--src/modules/statuses.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/modules/statuses.js b/src/modules/statuses.js
index 5f09b8f5..4fcfcdd2 100644
--- a/src/modules/statuses.js
+++ b/src/modules/statuses.js
@@ -146,7 +146,8 @@ const removeStatusFromGlobalStorage = (state, status) => {
}
}
-const addNewStatuses = (state, { statuses, showImmediately = false, timeline, user = {}, noIdUpdate = false, userId }) => {
+const addNewStatuses = (state, { statuses, showImmediately = false, timeline, user = {},
+ noIdUpdate = false, userId, isPinned = false }) => {
// Sanity check
if (!isArray(statuses)) {
return false
@@ -160,10 +161,10 @@ const addNewStatuses = (state, { statuses, showImmediately = false, timeline, us
const newer = timeline && (maxNew > timelineObject.maxId || timelineObject.maxId === 0) && statuses.length > 0
const older = timeline && (minNew < timelineObject.minId || timelineObject.minId === 0) && statuses.length > 0
- if (!noIdUpdate && newer) {
+ if (!noIdUpdate && newer && !isPinned) {
timelineObject.maxId = maxNew
}
- if (!noIdUpdate && older) {
+ if (!noIdUpdate && older && !isPinned) {
timelineObject.minId = minNew
}
@@ -504,8 +505,8 @@ export const mutations = {
const statuses = {
state: defaultState(),
actions: {
- addNewStatuses ({ rootState, commit }, { statuses, showImmediately = false, timeline = false, noIdUpdate = false, userId }) {
- commit('addNewStatuses', { statuses, showImmediately, timeline, noIdUpdate, user: rootState.users.currentUser, userId })
+ addNewStatuses ({ rootState, commit }, { statuses, showImmediately = false, timeline = false, noIdUpdate = false, userId, isPinned = false }) {
+ commit('addNewStatuses', { statuses, showImmediately, timeline, noIdUpdate, user: rootState.users.currentUser, userId, isPinned })
},
addNewNotifications ({ rootState, commit, dispatch, rootGetters }, { notifications, older }) {
commit('addNewNotifications', { visibleNotificationTypes: visibleNotificationTypes(rootState), dispatch, notifications, older, rootGetters })
@@ -543,7 +544,7 @@ const statuses = {
},
fetchPinnedStatuses ({ rootState, dispatch }, userId) {
rootState.api.backendInteractor.fetchPinnedStatuses(userId)
- .then(statuses => dispatch('addNewStatuses', { statuses, timeline: 'user', userId, showImmediately: true }))
+ .then(statuses => dispatch('addNewStatuses', { statuses, timeline: 'user', userId, showImmediately: true, isPinned: true }))
},
pinStatus ({ rootState, commit }, statusId) {
return rootState.api.backendInteractor.pinOwnStatus(statusId)