Skip to content

Commit 6b22b0c

Browse files
committed
Fix update interval
1 parent 3025671 commit 6b22b0c

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

apps/desktop/src/routes/[projectId]/+layout.svelte

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -255,22 +255,19 @@
255255
256256
// Auto-fetch setup
257257
async function fetchRemoteForProject() {
258-
if (baseBranch?.lastFetchedMs && Date.now() - baseBranch.lastFetchedMs > 30 * 60 * 1000) {
259-
await baseBranchService.fetchFromRemotes(projectId, 'auto');
260-
}
258+
await baseBranchService.fetchFromRemotes(projectId, 'auto');
261259
}
262260
263261
function setupFetchInterval() {
264262
const autoFetchIntervalMinutes = $settingsStore?.fetch.autoFetchIntervalMinutes || 15;
263+
clearFetchInterval();
264+
265265
if (autoFetchIntervalMinutes < 0) {
266266
return;
267267
}
268268
fetchRemoteForProject();
269-
clearFetchInterval();
270269
const intervalMs = autoFetchIntervalMinutes * 60 * 1000;
271-
intervalId = setInterval(async () => {
272-
await fetchRemoteForProject();
273-
}, intervalMs);
270+
intervalId = setInterval(async () => await fetchRemoteForProject(), intervalMs);
274271
275272
return () => clearFetchInterval();
276273
}

0 commit comments

Comments
 (0)