From eb91b6ea6d287c3077c9db3785d0e420b669b6ed Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Thu, 5 Sep 2024 13:28:19 +0530 Subject: [PATCH] Doc --- web/apps/photos/src/services/sync.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/web/apps/photos/src/services/sync.ts b/web/apps/photos/src/services/sync.ts index c96e239526..ce6b03cbf3 100644 --- a/web/apps/photos/src/services/sync.ts +++ b/web/apps/photos/src/services/sync.ts @@ -16,9 +16,14 @@ export const triggerPreFileInfoSync = () => { }; /** - * Perform a soft "refresh" by making various API calls to fetch state from - * remote, using it to update our local state, and triggering periodic jobs that - * depend on the local state. + * Sync our local state with remote on page load for web and focus for desktop. + * + * This function makes various API calls to fetch state from remote, using it to + * update our local state, and triggering periodic jobs that depend on the local + * state. + * + * This runs on initial page load (on both web and desktop). In addition for + * desktop, it also runs each time the desktop app gains focus. * * TODO: This is called after we've synced the local files DBs with remote. That * code belongs here, but currently that state is persisted in the top level