From 7e76f40f431eda282943e33f9997031a1922b40a Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Wed, 11 Jun 2025 15:26:33 +0530 Subject: [PATCH] Handle --- .../src/components/Collections/CollectionShare.tsx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/web/apps/photos/src/components/Collections/CollectionShare.tsx b/web/apps/photos/src/components/Collections/CollectionShare.tsx index f8106e6004..a2b64a2ceb 100644 --- a/web/apps/photos/src/components/Collections/CollectionShare.tsx +++ b/web/apps/photos/src/components/Collections/CollectionShare.tsx @@ -508,19 +508,24 @@ const AddParticipant: React.FC = ({ try { await shareCollection(collection, email, role); } catch (e) { + if (isHTTPErrorWithStatus(e, 402)) { + setEmailFieldError(t("sharing_disabled_for_free_accounts")); + return; + } + if (isHTTPErrorWithStatus(e, 404)) { setEmailFieldError(t("sharing_user_does_not_exist")); return; } - // TODO(RE): - setEmailFieldError(handleSharingErrors(e)); - return; + + throw e; } } if (emails.length) { await syncWithRemote(false, true); } + onClose(); }; @@ -594,7 +599,7 @@ const AddParticipantForm: React.FC = ({ }); const resetExistingSelection = () => - formik.setFieldValue("selectedOptions", []); + formik.setFieldValue("selectedEmails", []); return (