commit
095592077b
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "bada-frame",
|
||||
"version": "0.5.0",
|
||||
"version": "0.5.1",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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<Collection[]>(PUBLIC_COLLECTIONS_TABLE)) ||
|
||||
[];
|
||||
|
|
Loading…
Reference in a new issue