if (res.state === "success") {
if (res.data.msg === "ok") {
i.props.onUpload(res.data.url as string);
+ } else if (res.data.msg === "too_large") {
+ toast(I18NextService.i18n.t("upload_too_large"), "danger");
} else {
toast(JSON.stringify(res), "danger");
}
const textarea: any = document.getElementById(i.id);
autosize.update(textarea);
pictrsDeleteToast(image.name, res.data.delete_url as string);
+ } else if (res.data.msg === "too_large") {
+ toast(I18NextService.i18n.t("upload_too_large"), "danger");
+ i.setState({ imageUploadStatus: undefined });
+ throw JSON.stringify(res.data);
} else {
throw JSON.stringify(res.data);
}
{ form: form, index: index, overrideValue: res.data.url as string },
event
);
+ } else if (res.data.msg === "too_large") {
+ toast(I18NextService.i18n.t("upload_too_large"), "danger");
} else {
toast(JSON.stringify(res), "danger");
}
imageLoading: false,
imageDeleteUrl: res.data.delete_url as string,
});
+ } else if (res.data.msg === "too_large") {
+ toast(I18NextService.i18n.t("upload_too_large"), "danger");
} else {
toast(JSON.stringify(res), "danger");
}