refactor(reading): increase debounce to 3 seconds

This commit is contained in:
Gigi
2025-10-22 23:18:40 +02:00
parent b5717f1ebf
commit 9167134a89
2 changed files with 3 additions and 3 deletions

View File

@@ -16,8 +16,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Reading position auto-save now uses simple 2-second debounce
- Saves only after 2s of no scrolling (was 15s minimum interval)
- Reading position auto-save now uses simple 3-second debounce
- Saves only after 3s of no scrolling (was 15s minimum interval)
- Much less aggressive, reduces relay traffic
- Still saves instantly at 100% completion

View File

@@ -70,7 +70,7 @@ export const useReadingPosition = ({
clearTimeout(saveTimerRef.current)
}
const DEBOUNCE_MS = 2000 // Save max every 2 seconds
const DEBOUNCE_MS = 3000 // Save max every 3 seconds
console.log('[reading-position] ⏱️ Debouncing save for', DEBOUNCE_MS, 'ms (pos:', Math.round(currentPosition * 100) + '%)')
saveTimerRef.current = setTimeout(() => {
console.log('[reading-position] 💾 Auto-save at', Math.round(currentPosition * 100) + '%')