diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2019-03-06 04:53:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-06 04:53:37 +0100 |
commit | d97cbb0da60f32c9e7e60445af329173b0df1aa7 (patch) | |
tree | 65e465284f132edede32ae8335ef840e8bdef1c7 /app/javascript/mastodon/actions/statuses.js | |
parent | 4407f07014096bcbaf5a06015a5791984282846d (diff) |
Add UI for creating polls (#10184)
* Add actions and reducers for polls * Add poll button * Disable media upload if poll enabled * Add poll form * Make delete & redraft work with polls
Diffstat (limited to 'app/javascript/mastodon/actions/statuses.js')
-rw-r--r-- | app/javascript/mastodon/actions/statuses.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/javascript/mastodon/actions/statuses.js b/app/javascript/mastodon/actions/statuses.js index e7c89b4ba..1794538e2 100644 --- a/app/javascript/mastodon/actions/statuses.js +++ b/app/javascript/mastodon/actions/statuses.js @@ -140,7 +140,11 @@ export function redraft(status) { export function deleteStatus(id, router, withRedraft = false) { return (dispatch, getState) => { - const status = getState().getIn(['statuses', id]); + let status = getState().getIn(['statuses', id]); + + if (status.get('poll')) { + status = status.set('poll', getState().getIn(['polls', status.get('poll')])); + } dispatch(deleteStatusRequest(id)); |