Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[web][photos] Handle url-update err

Neeraj Gupta2d588435812a
diff --git a/web/apps/photos/src/components/Collections/CollectionShare.tsx b/web/apps/photos/src/components/Collections/CollectionShare.tsx
index 0393a39847..bc35e249b5 100644
--- a/web/apps/photos/src/components/Collections/CollectionShare.tsx
+++ b/web/apps/photos/src/components/Collections/CollectionShare.tsx
@@ -47,7 +47,7 @@ import {
} from "ente-base/components/utils/modal";
import { useBaseContext } from "ente-base/context";
import { deriveInteractiveKey } from "ente-base/crypto";
-import { isHTTPErrorWithStatus } from "ente-base/http";
+import { isHTTPErrorWithStatus, isMuseumHTTPError } from "ente-base/http";
import { formattedDateTime } from "ente-base/i18n-date";
import log from "ente-base/log";
import { appendCollectionKeyToShareURL } from "ente-gallery/services/share";
@@ -1817,7 +1817,13 @@ const ManagePublicShareOptions: React.FC<ManagePublicShareOptionsProps> = ({
void onRemotePull({ silent: true });
} catch (e) {
log.error("Could not update public link", e);
- setErrorMessage(t("generic_error"));
+ if (
+ await isMuseumHTTPError(e, 403, "LINK_EDIT_NOT_ALLOWED")
+ ) {
+ setErrorMessage(t("link_edit_disabled_for_free_accounts"));
+ } else {
+ setErrorMessage(t("generic_error"));
+ }
} finally {
setBlockingLoad(false);
}
diff --git a/web/packages/base/locales/en-US/translation.json b/web/packages/base/locales/en-US/translation.json
index 8b372a5875..bb2db8a394 100644
--- a/web/packages/base/locales/en-US/translation.json
+++ b/web/packages/base/locales/en-US/translation.json
@@ -247,6 +247,7 @@
"sharing_already_shared": "You're already sharing this with {{email}}",
"sharing_album_not_allowed": "Sharing album not allowed",
"sharing_disabled_for_free_accounts": "Sharing is disabled for free accounts",
+ "link_edit_disabled_for_free_accounts": "You need a paid subscription to change this link setting",
"sharing_user_does_not_exist": "Could not find a user with that email",
"search": "Search",
"search_results": "Search results",