refactor(autosave): rename flushViaBeacon → flushOnUnload; add void to fire-and-forget fetch

The sendBeacon name was misleading after switching to keepalive fetch.
Also adds a test to confirm flush is a no-op when pendingTexts is empty.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-04-22 16:46:58 +02:00
committed by marcel
parent c9dd3f8e78
commit ff0bb89297
3 changed files with 21 additions and 9 deletions

View File

@@ -73,7 +73,7 @@ $effect(() => {
$effect(() => {
function onBeforeUnload() {
autoSave.flushViaBeacon();
autoSave.flushOnUnload();
}
window.addEventListener('beforeunload', onBeforeUnload);
return () => {