From a850500beb9e9a5ffcfc3a0f0cf93b3733e04972 Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Fri, 31 May 2024 14:29:28 +0530 Subject: [PATCH] Clear --- web/apps/photos/src/pages/gallery/index.tsx | 2 +- web/apps/photos/src/services/logout.ts | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/web/apps/photos/src/pages/gallery/index.tsx b/web/apps/photos/src/pages/gallery/index.tsx index 5062aa6b6f..a1cba432c1 100644 --- a/web/apps/photos/src/pages/gallery/index.tsx +++ b/web/apps/photos/src/pages/gallery/index.tsx @@ -384,7 +384,6 @@ export default function Gallery() { syncInterval.current = setInterval(() => { syncWithRemote(false, true); }, SYNC_INTERVAL_IN_MICROSECONDS); - fetchAndSaveFeatureFlagsIfNeeded(); if (electron) { // void clipService.setupOnFileUploadListener(); electron.onMainWindowFocus(() => syncWithRemote(false, true)); @@ -715,6 +714,7 @@ export default function Gallery() { await syncTrash(collections, setTrashedFiles); await syncEntities(); await syncMapEnabled(); + fetchAndSaveFeatureFlagsIfNeeded(); const electron = globalThis.electron; if (electron) { await syncCLIPEmbeddings(); diff --git a/web/apps/photos/src/services/logout.ts b/web/apps/photos/src/services/logout.ts index 4e09516dee..9da892bad2 100644 --- a/web/apps/photos/src/services/logout.ts +++ b/web/apps/photos/src/services/logout.ts @@ -4,6 +4,7 @@ import { clipService } from "services/clip-service"; import DownloadManager from "./download"; import exportService from "./export"; import { clearFaceData } from "./face/db"; +import { clearFeatureFlagSessionState } from "./feature-flag"; import mlWorkManager from "./machineLearning/mlWorkManager"; /** @@ -19,6 +20,12 @@ export const photosLogout = async () => { await accountLogout(); + try { + clearFeatureFlagSessionState(); + } catch (e) { + ignoreError("feature-flag", e); + } + try { await DownloadManager.logout(); } catch (e) {