π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Swap
Manav Rathibd776dc98d63
diff --git a/web/apps/photos/src/pages/shared-albums.tsx b/web/apps/photos/src/pages/shared-albums.tsxindex 57e9ef95c6..5d1826e407 100644--- a/web/apps/photos/src/pages/shared-albums.tsx+++ b/web/apps/photos/src/pages/shared-albums.tsx@@ -50,7 +50,10 @@ import { updateShouldDisableCFUploadProxy } from "ente-gallery/services/upload";import { sortFiles } from "ente-gallery/utils/file";import type { Collection } from "ente-media/collection";import { type EnteFile } from "ente-media/file";-import { savedPublicCollectionFiles } from "ente-new/albums/services/public-albums-fdb";+import {+ savedLastPublicAlbumReferralCode,+ savedPublicCollectionFiles,+} from "ente-new/albums/services/public-albums-fdb";import { verifyPublicAlbumPassword } from "ente-new/albums/services/public-collection";import {GalleryItemsHeaderAdapter,@@ -69,7 +72,6 @@ import {getLocalPublicCollectionPassword,getPublicCollection,getPublicCollectionUID,- getReferralCode,removePublicCollectionWithFiles,removePublicFiles,savePublicCollectionPassword,@@ -220,7 +222,8 @@ export default function PublicCollectionGallery() {const accessToken = t;let accessTokenJWT: string | undefined;if (localCollection) {- referralCode.current = await getReferralCode();+ referralCode.current =+ await savedLastPublicAlbumReferralCode();const sortAsc: boolean =localCollection?.pubMagicMetadata?.data.asc ?? false;setPublicCollection(localCollection);diff --git a/web/apps/photos/src/services/publicCollectionService.ts b/web/apps/photos/src/services/publicCollectionService.tsindex 4a6cc655cb..5ce359785a 100644--- a/web/apps/photos/src/services/publicCollectionService.ts+++ b/web/apps/photos/src/services/publicCollectionService.ts@@ -11,6 +11,7 @@ import { decryptRemoteFile } from "ente-media/file";import {savedPublicCollectionFiles,savedPublicCollections,+ saveLastPublicAlbumReferralCode,savePublicCollectionFiles,} from "ente-new/albums/services/public-albums-fdb";import { CustomError, parseSharingErrorCodes } from "ente-shared/error";@@ -19,7 +20,6 @@ import localForage from "ente-shared/storage/localForage";const PUBLIC_COLLECTION_FILES_TABLE = "public-collection-files";const PUBLIC_COLLECTIONS_TABLE = "public-collections";-const PUBLIC_REFERRAL_CODE = "public-referral-code";// Fix this once we can trust the types.// eslint-disable-next-line @typescript-eslint/no-unnecessary-template-expression@@ -91,17 +91,6 @@ export const savePublicCollection = async (collection: Collection) => {);};-export const getReferralCode = async () => {- return await localForage.getItem<string>(PUBLIC_REFERRAL_CODE);-};--export const saveReferralCode = async (code: string) => {- if (!code) {- localForage.removeItem(PUBLIC_REFERRAL_CODE);- }- await localForage.setItem(PUBLIC_REFERRAL_CODE, code);-};-const dedupeCollections = (collections: Collection[]) => {const keySet = new Set([]);return collections.filter((collection) => {@@ -322,7 +311,7 @@ export const getPublicCollection = async (pubMagicMetadata: collectionPublicMagicMetadata,};await savePublicCollection(collection);- await saveReferralCode(referralCode);+ await saveLastPublicAlbumReferralCode(referralCode);return [collection, referralCode];} catch (e) {log.error("failed to get public collection", e);