Skip to content

Commit 94c6a2f

Browse files
committed
Ask for storage persistence in .persistResult(…).
1 parent a6931d8 commit 94c6a2f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/timer.cubing.net/app/TimerApp.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ export class TimerApp {
231231
await this.updateDisplayStats(true);
232232
}
233233

234-
// biome-ignore lint/correctness/noUnusedPrivateClassMembers: Used to deduplicate
234+
// biome-ignore lint/correctness/noUnusedPrivateClassMembers: False positive: https://github.com/biomejs/biome/issues/7192
235235
#persistenceRequest: Promise<boolean> | undefined;
236236
private async persistResult(time: Milliseconds): Promise<void> {
237237
const attemptData: AttemptData = {
@@ -244,6 +244,10 @@ export class TimerApp {
244244
attemptData.device = localStorage["pouchDBDeviceName"];
245245
}
246246
await this.session.addNewAttempt(attemptData);
247+
// This is probably the clearest time that we can signal to the browser that
248+
// persistent storage is warranted. Note that this may or may not result in
249+
// a request shown to the user, and may or may not be granted in either
250+
// case.
247251
this.#persistenceRequest ??= navigator.storage.persist();
248252
}
249253

0 commit comments

Comments
 (0)