Commit 64ff2cff authored by Paul Kaplan's avatar Paul Kaplan

Move max image size to constant

parent e2dafff5
......@@ -24,6 +24,8 @@ const Errors = keyMirror({
UNHANDLED: null
});
const MAX_IMAGE_BYTES = 524288;
const getInitialState = () => ({
mutationErrors: {}, // { [field]: <error>, ... }
isMutating: {} // { [field]: <boolean>, ... }
......@@ -176,7 +178,7 @@ const mutateStudioImage = input => ((dispatch, getState) => {
const studioId = selectStudioId(state);
const currentImage = selectStudioImage(state);
dispatch(startMutation('image'));
if (input.files[0].size && input.files[0].size > 524288) {
if (input.files[0].size && input.files[0].size > MAX_IMAGE_BYTES) {
return dispatch(completeMutation('image', currentImage, Errors.THUMBNAIL_TOO_LARGE));
}
const formData = new FormData();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment