Merge pull request #367 from ente-io/master

release
This commit is contained in:
Vishnu Mohandas 2022-02-12 14:10:55 +05:30 committed by GitHub
commit 095592077b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 9 deletions

View file

@ -1,6 +1,6 @@
{
"name": "bada-frame",
"version": "0.5.0",
"version": "0.5.1",
"private": true,
"scripts": {
"dev": "next dev",

View file

@ -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)

View file

@ -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)) ||
[];