feat: add a proper error message when file is too big (#2247)

This commit is contained in:
Pierre-Monier 2020-10-18 10:39:55 +02:00 committed by GitHub
parent 8f5c5f80d3
commit 41ccd47791
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -218,8 +218,9 @@ export const exportToBackend = async (
// of queryParam in order to never send it to the server
url.hash = `json=${json.id},${exportedKey.k!}`;
const urlString = url.toString();
window.prompt(`🔒${t("alerts.uploadedSecurly")}`, urlString);
} else if (json.error_class === "RequestTooLargeError") {
window.alert(t("alerts.couldNotCreateShareableLinkTooBig"));
} else {
window.alert(t("alerts.couldNotCreateShareableLink"));
}

View File

@ -109,6 +109,7 @@
"alerts": {
"clearReset": "This will clear the whole canvas. Are you sure?",
"couldNotCreateShareableLink": "Couldn't create shareable link.",
"couldNotCreateShareableLinkTooBig": "Couldn't create shareable link: the scene is too big",
"couldNotLoadInvalidFile": "Couldn't load invalid file",
"importBackendFailed": "Importing from backend failed.",
"cannotExportEmptyCanvas": "Cannot export empty canvas.",