diff options
author | Mélanie Chauvel (ariasuni) <perso@hack-libre.org> | 2018-08-11 11:52:53 +0200 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2018-08-11 11:52:53 +0200 |
commit | 7b5ea7270db8de2a57e3a93dad4aaa5cd46d2d99 (patch) | |
tree | d0d88950ae0536ae50a1bafe7525266c565cbafd /app/javascript | |
parent | 84e2446d26d7ef6031ae5c63a9c311e28a0dadaa (diff) |
Fix crash when clicking “Show more/less for all” when a toot is not visible (#8118)
Diffstat (limited to 'app/javascript')
-rw-r--r-- | app/javascript/mastodon/reducers/statuses.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/app/javascript/mastodon/reducers/statuses.js b/app/javascript/mastodon/reducers/statuses.js index 3abe69bce..6e3d830da 100644 --- a/app/javascript/mastodon/reducers/statuses.js +++ b/app/javascript/mastodon/reducers/statuses.js @@ -49,11 +49,19 @@ export default function statuses(state = initialState, action) { return state.setIn([action.id, 'muted'], false); case STATUS_REVEAL: return state.withMutations(map => { - action.ids.forEach(id => map.setIn([id, 'hidden'], false)); + action.ids.forEach(id => { + if (!(state.get(id) === undefined)) { + map.setIn([id, 'hidden'], false); + } + }); }); case STATUS_HIDE: return state.withMutations(map => { - action.ids.forEach(id => map.setIn([id, 'hidden'], true)); + action.ids.forEach(id => { + if (!(state.get(id) === undefined)) { + map.setIn([id, 'hidden'], true); + } + }); }); case TIMELINE_DELETE: return deleteStatus(state, action.id, action.references); |