diff options
| author | Shpuld Shpludson <shp@cock.li> | 2019-09-03 04:48:24 +0000 |
|---|---|---|
| committer | Shpuld Shpludson <shp@cock.li> | 2019-09-03 04:48:24 +0000 |
| commit | 6238fe363351ca44887773d682bfe893e86506a7 (patch) | |
| tree | 6c50907c5c88db77c4bb314f40799f85d9f651eb /src/modules/statuses.js | |
| parent | c43a5ab992dbf6d83edc24633db7317529861bd4 (diff) | |
| parent | daf7d4e66179a844dd467f16a195ac5eada09ad1 (diff) | |
Merge branch '652' into 'develop'
Fix "TypeError: Cannot set property 'pinned' of undefined"
Closes #652
See merge request pleroma/pleroma-fe!936
Diffstat (limited to 'src/modules/statuses.js')
| -rw-r--r-- | src/modules/statuses.js | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/modules/statuses.js b/src/modules/statuses.js index e863d8a5..4356d0a7 100644 --- a/src/modules/statuses.js +++ b/src/modules/statuses.js @@ -426,10 +426,6 @@ export const mutations = { newStatus.favoritedBy.push(user) } }, - setPinned (state, status) { - const newStatus = state.allStatusesObject[status.id] - newStatus.pinned = status.pinned - }, setMuted (state, status) { const newStatus = state.allStatusesObject[status.id] newStatus.muted = status.muted @@ -560,13 +556,13 @@ const statuses = { rootState.api.backendInteractor.fetchPinnedStatuses(userId) .then(statuses => dispatch('addNewStatuses', { statuses, timeline: 'user', userId, showImmediately: true, noIdUpdate: true })) }, - pinStatus ({ rootState, commit }, statusId) { + pinStatus ({ rootState, dispatch }, statusId) { return rootState.api.backendInteractor.pinOwnStatus(statusId) - .then((status) => commit('setPinned', status)) + .then((status) => dispatch('addNewStatuses', { statuses: [status] })) }, - unpinStatus ({ rootState, commit }, statusId) { + unpinStatus ({ rootState, dispatch }, statusId) { rootState.api.backendInteractor.unpinOwnStatus(statusId) - .then((status) => commit('setPinned', status)) + .then((status) => dispatch('addNewStatuses', { statuses: [status] })) }, muteConversation ({ rootState, commit }, statusId) { return rootState.api.backendInteractor.muteConversation(statusId) |
