Skip to content

Commit c47d15a

Browse files
beastoinclaude
andcommitted
fix(desktop): replace memories polling timer with activation + Cmd+R (#6500)
Remove periodic 120s memories refresh timer. Memories now refresh on app activation, page visibility, and Cmd+R. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 469eaff commit c47d15a

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

desktop/Desktop/Sources/MainWindow/Pages/MemoriesPage.swift

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,15 @@ class MemoriesViewModel: ObservableObject {
206206
// MARK: - Initialization
207207

208208
init() {
209-
// Auto-refresh memories periodically
210-
Timer.publish(every: PollingConfig.memoriesPollInterval, on: .main, in: .common)
211-
.autoconnect()
209+
// Refresh memories when app becomes active
210+
NotificationCenter.default.publisher(for: NSApplication.didBecomeActiveNotification)
211+
.sink { [weak self] _ in
212+
Task { await self?.refreshMemoriesIfNeeded() }
213+
}
214+
.store(in: &cancellables)
215+
216+
// Cmd+R: refresh memories on demand
217+
NotificationCenter.default.publisher(for: .refreshAllData)
212218
.sink { [weak self] _ in
213219
Task { await self?.refreshMemoriesIfNeeded() }
214220
}

0 commit comments

Comments
 (0)