about summary refs log tree commit diff
path: root/app/javascript/mastodon/actions/statuses.js
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-03-06 04:53:37 +0100
committerGitHub <noreply@github.com>2019-03-06 04:53:37 +0100
commitd97cbb0da60f32c9e7e60445af329173b0df1aa7 (patch)
tree65e465284f132edede32ae8335ef840e8bdef1c7 /app/javascript/mastodon/actions/statuses.js
parent4407f07014096bcbaf5a06015a5791984282846d (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.js6
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));