Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Fix

Manav Rathi384fcf4b3891
diff --git a/web/apps/photos/src/pages/gallery.tsx b/web/apps/photos/src/pages/gallery.tsx
index 5aa59739a0..d359f139e0 100644
--- a/web/apps/photos/src/pages/gallery.tsx
+++ b/web/apps/photos/src/pages/gallery.tsx
@@ -25,7 +25,7 @@ import {
useGalleryReducer,
type GalleryBarMode,
} from "@/new/photos/components/gallery/reducer";
-import { usePeopleStateSnapshot } from "@/new/photos/components/utils/ml";
+import { usePeopleStateSnapshot } from "@/new/photos/components/utils/use-snapshot";
import { shouldShowWhatsNew } from "@/new/photos/services/changelog";
import {
ALL_SECTION,
@@ -34,6 +34,7 @@ import {
} from "@/new/photos/services/collection";
import { areOnlySystemCollections } from "@/new/photos/services/collection/ui";
import downloadManager from "@/new/photos/services/download";
+import { getLocalFamilyData } from "@/new/photos/services/family";
import {
getLocalFiles,
getLocalTrashedFiles,
@@ -363,7 +364,9 @@ export default function Gallery() {
}
setIsFirstLogin(false);
const user = getData(LS_KEYS.USER);
- const familyData = userDetailsSnapshot().familyData;
+ // TODO: Temp fallback
+ const familyData =
+ userDetailsSnapshot()?.familyData ?? getLocalFamilyData();
const files = sortFiles(
mergeMetadata(await getLocalFiles("normal")),
);
diff --git a/web/packages/new/photos/services/user.ts b/web/packages/new/photos/services/user.ts
index f9549c5e24..622c7f37eb 100644
--- a/web/packages/new/photos/services/user.ts
+++ b/web/packages/new/photos/services/user.ts
@@ -69,12 +69,8 @@ export const logoutUserDetails = () => {
* This assumes that the user is already logged in.
*/
export const initUserDetails = async () => {
- await syncUserDetailsSnapshotWithLocalDB();
-};
-
-const syncUserDetailsSnapshotWithLocalDB = async () => {
- const userDetails = UserDetails.parse(await getKV("userDetails"));
- setUserDetailsSnapshot(userDetails);
+ const saved = await getKV("userDetails");
+ if (saved) setUserDetailsSnapshot(UserDetails.parse(saved));
};
/**