diff options
| author | taehoon <th.dev91@gmail.com> | 2019-04-24 16:19:27 -0400 |
|---|---|---|
| committer | taehoon <th.dev91@gmail.com> | 2019-05-15 12:04:25 -0400 |
| commit | 1229622fedf4401f2ce2e5aa6741de3a8b1291a3 (patch) | |
| tree | 34e77fdf0db2148f4f71c860f4ffeab1153ac51d /src/modules/statuses.js | |
| parent | ce1d19136de322637695891b11117946664eacd6 (diff) | |
refactor error handling of pinStatus
Diffstat (limited to 'src/modules/statuses.js')
| -rw-r--r-- | src/modules/statuses.js | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/modules/statuses.js b/src/modules/statuses.js index 9b4eb0f7..b3d6802c 100644 --- a/src/modules/statuses.js +++ b/src/modules/statuses.js @@ -546,12 +546,8 @@ const statuses = { .then(statuses => dispatch('addNewStatuses', { statuses, timeline: 'user', userId })) }, pinStatus ({ rootState, commit }, statusId) { - return rootState.api.backendInteractor.pinOwnStatus(statusId).then((status) => { - if (!status.error) { - commit('setPinned', { status }) - } - return status - }) + return rootState.api.backendInteractor.pinOwnStatus(statusId) + .then((status) => commit('setPinned', { status })) }, unpinStatus ({ rootState, commit }, statusId) { rootState.api.backendInteractor.unpinOwnStatus(statusId) |
