diff --git a/package.json b/package.json index 0c54b58e7..322c2ffab 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bada-frame", - "version": "0.5.0", + "version": "0.5.1", "private": true, "scripts": { "dev": "next dev", diff --git a/src/pages/shared-albums/index.tsx b/src/pages/shared-albums/index.tsx index f737a4bc9..4f245dda3 100644 --- a/src/pages/shared-albums/index.tsx +++ b/src/pages/shared-albums/index.tsx @@ -104,10 +104,7 @@ export default function PublicCollectionGallery() { ); if (localCollection) { setPublicCollection(localCollection); - const collectionUID = getPublicCollectionUID( - collectionKey.current, - token.current - ); + const collectionUID = getPublicCollectionUID(token.current); const localFiles = await getLocalPublicFiles(collectionUID); const localPublicFiles = sortFiles( mergeMetadata(localFiles) diff --git a/src/services/publicCollectionService.ts b/src/services/publicCollectionService.ts index 55b9b5284..29426b8bc 100644 --- a/src/services/publicCollectionService.ts +++ b/src/services/publicCollectionService.ts @@ -17,8 +17,7 @@ const ENDPOINT = getEndpoint(); const PUBLIC_COLLECTION_FILES_TABLE = 'public-collection-files'; const PUBLIC_COLLECTIONS_TABLE = 'public-collections'; -export const getPublicCollectionUID = (collectionKey: string, token: string) => - `${collectionKey.slice(0, 8)}-${token.slice(0, 8)}`; +export const getPublicCollectionUID = (token: string) => `${token}`; const getPublicCollectionSyncTimeUID = (collectionUID: string) => `public-${collectionUID}-time`; @@ -125,7 +124,7 @@ export const syncPublicFiles = async ( ) => { try { let files: EnteFile[] = []; - const collectionUID = getPublicCollectionUID(collection.key, token); + const collectionUID = getPublicCollectionUID(token); const localFiles = await getLocalPublicFiles(collectionUID); files.push(...localFiles); try { @@ -311,7 +310,7 @@ export const removePublicCollectionWithFiles = async ( token: string, collectionKey: string ) => { - const collectionUID = getPublicCollectionUID(collectionKey, token); + const collectionUID = getPublicCollectionUID(token); const publicCollections = (await localForage.getItem(PUBLIC_COLLECTIONS_TABLE)) || [];