diff --git a/app/javascript/mastodon/actions/compose.js b/app/javascript/mastodon/actions/compose.js
index 2dcb81035de9c4..c9c1a420bd2de4 100644
--- a/app/javascript/mastodon/actions/compose.js
+++ b/app/javascript/mastodon/actions/compose.js
@@ -207,10 +207,11 @@ export function uploadCompose(files) {
return function (dispatch, getState) {
const uploadLimit = 4;
const media = getState().getIn(['compose', 'media_attachments']);
+ const pending = getState().getIn(['compose', 'pending_media_attachments']);
const progress = new Array(files.length).fill(0);
let total = Array.from(files).reduce((a, v) => a + v.size, 0);
- if (files.length + media.size > uploadLimit) {
+ if (files.length + media.size + pending > uploadLimit) {
dispatch(showAlert(undefined, messages.uploadErrorLimit));
return;
}
@@ -237,7 +238,7 @@ export function uploadCompose(files) {
dispatch(uploadComposeProgress(progress.reduce((a, v) => a + v, 0), total));
},
}).then(({ data }) => dispatch(uploadComposeSuccess(data, f)));
- }).catch(error => dispatch(uploadComposeFail(error)));
+ }).catch(error => dispatch(uploadComposeFail(error, true)));
};
};
};
@@ -268,10 +269,11 @@ export function changeUploadComposeSuccess(media) {
};
};
-export function changeUploadComposeFail(error) {
+export function changeUploadComposeFail(error, decrement = false) {
return {
type: COMPOSE_UPLOAD_CHANGE_FAIL,
error: error,
+ decrement: decrement,
skipLoading: true,
};
};
diff --git a/app/javascript/mastodon/features/compose/components/poll_form.js b/app/javascript/mastodon/features/compose/components/poll_form.js
index 211601d520602f..898f956b0c0f79 100644
--- a/app/javascript/mastodon/features/compose/components/poll_form.js
+++ b/app/javascript/mastodon/features/compose/components/poll_form.js
@@ -142,9 +142,7 @@ class PollForm extends ImmutablePureComponent {
- {options.size < 4 && (
-
- )}
+