Tweak
This commit is contained in:
@@ -214,7 +214,7 @@ export interface CollectionChange {
|
||||
* will be at most one entry for a given collection in the result array. See:
|
||||
* [Note: Diff response will have at most one entry for an id]
|
||||
*/
|
||||
export const getCollectionChanges = async (
|
||||
export const getCollections = async (
|
||||
sinceTime: number,
|
||||
): Promise<CollectionChange[]> => {
|
||||
const res = await fetch(
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { type Collection } from "ente-media/collection";
|
||||
import localForage from "ente-shared/storage/localForage";
|
||||
import { getCollectionChanges, isHiddenCollection } from "./collection";
|
||||
import { getCollections, isHiddenCollection } from "./collection";
|
||||
import { savedCollections } from "./photos-fdb";
|
||||
|
||||
const COLLECTION_TABLE = "collections";
|
||||
@@ -43,15 +43,10 @@ export const getLatestCollections = async (
|
||||
};
|
||||
|
||||
export const getAllLatestCollections = async (): Promise<Collection[]> => {
|
||||
const collections = await syncCollections();
|
||||
return collections;
|
||||
};
|
||||
|
||||
export const syncCollections = async () => {
|
||||
const localCollections = await savedCollections();
|
||||
let sinceTime = await getCollectionUpdationTime();
|
||||
|
||||
const changes = await getCollectionChanges(sinceTime);
|
||||
const changes = await getCollections(sinceTime);
|
||||
if (!changes.length) return localCollections;
|
||||
|
||||
const hiddenCollectionIDs = await getHiddenCollectionIDs();
|
||||
|
||||
Reference in New Issue
Block a user