From 41ccd4779118e5a20121dd73afcb13bedc9e982a Mon Sep 17 00:00:00 2001 From: Pierre-Monier <65488471+Pierre-Monier@users.noreply.github.com> Date: Sun, 18 Oct 2020 10:39:55 +0200 Subject: [PATCH] feat: add a proper error message when file is too big (#2247) --- src/data/index.ts | 3 ++- src/locales/en.json | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/data/index.ts b/src/data/index.ts index 44a58b31..39c8aff2 100644 --- a/src/data/index.ts +++ b/src/data/index.ts @@ -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")); } diff --git a/src/locales/en.json b/src/locales/en.json index 638016ed..8d7adf9d 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -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.",