remove deleted collection from local
This commit is contained in:
parent
a1a73b0cbd
commit
37bb67ea21
|
@ -23,6 +23,7 @@ import {
|
|||
getFavItemIds,
|
||||
getLocalCollections,
|
||||
getNonEmptyCollections,
|
||||
setLocalCollection,
|
||||
} from 'services/collectionService';
|
||||
import constants from 'utils/strings/constants';
|
||||
import billingService from 'services/billingService';
|
||||
|
@ -258,6 +259,7 @@ export default function Gallery() {
|
|||
collectionFilesCount.set(id, files.length);
|
||||
}
|
||||
setCollections(nonEmptyCollections);
|
||||
setLocalCollection(nonEmptyCollections);
|
||||
setCollectionsAndTheirLatestFile(collectionsAndTheirLatestFile);
|
||||
setCollectionFilesCount(collectionFilesCount);
|
||||
const favItemIds = await getFavItemIds(files);
|
||||
|
|
|
@ -184,6 +184,10 @@ export const syncCollections = async () => {
|
|||
return collections;
|
||||
};
|
||||
|
||||
export const setLocalCollection = async (collections: Collection[]) => {
|
||||
await localForage.setItem(COLLECTIONS, collections);
|
||||
};
|
||||
|
||||
export const getCollectionsAndTheirLatestFile = (
|
||||
collections: Collection[],
|
||||
files: File[]
|
||||
|
|
Loading…
Reference in a new issue