Trigger
This commit is contained in:
@@ -87,6 +87,7 @@ import {
|
||||
import downloadManager from "services/download";
|
||||
import { syncCLIPEmbeddings } from "services/embeddingService";
|
||||
import { syncEntities } from "services/entityService";
|
||||
import { fetchAndSaveFeatureFlags } from "services/feature-flag";
|
||||
import { getLocalFiles, syncFiles } from "services/fileService";
|
||||
import locationSearchService from "services/locationSearchService";
|
||||
import { getLocalTrashedFiles, syncTrash } from "services/trashService";
|
||||
@@ -340,6 +341,7 @@ export default function Gallery() {
|
||||
return;
|
||||
}
|
||||
preloadImage("/images/subscription-card-background");
|
||||
let ffTimeout: ReturnType<typeof setTimeout> | undefined;
|
||||
const electron = globalThis.electron;
|
||||
const main = async () => {
|
||||
const valid = await validateKey();
|
||||
@@ -383,6 +385,11 @@ export default function Gallery() {
|
||||
syncInterval.current = setInterval(() => {
|
||||
syncWithRemote(false, true);
|
||||
}, SYNC_INTERVAL_IN_MICROSECONDS);
|
||||
// Not critical, so fetch these after some delay.
|
||||
ffTimeout = setTimeout(() => {
|
||||
ffTimeout = undefined;
|
||||
void fetchAndSaveFeatureFlags();
|
||||
}, 5000);
|
||||
if (electron) {
|
||||
// void clipService.setupOnFileUploadListener();
|
||||
electron.onMainWindowFocus(() => syncWithRemote(false, true));
|
||||
@@ -391,6 +398,7 @@ export default function Gallery() {
|
||||
main();
|
||||
return () => {
|
||||
clearInterval(syncInterval.current);
|
||||
if (ffTimeout) clearTimeout(ffTimeout);
|
||||
if (electron) {
|
||||
electron.onMainWindowFocus(undefined);
|
||||
clipService.removeOnFileUploadListener();
|
||||
|
||||
Reference in New Issue
Block a user