fix: a very slow browser (like in parallel ui tests) may take very long to apply the history.back
Massimo Melina committed
Feb 21, 2026 at 20:12 UTC
dc612c467ba407883a57c3b5f8bab94a8e592f11
1 file changed
+2
-2
shared/dialogs.ts
+2
-2
@@ -79,12 +79,12 @@ async function back() {
79
ignorePopState = true
80
const was = history.state
81
return waitClosing = waitClosing.then(() => new Promise<void>(async res => {
82
- const timeout = Date.now() + 1000
82
+ const timeout = Date.now() + 1500
83
let lastBack = 0
84
while (was === history.state) { // history.back seems to not always be effective, so we loop for it
85
const now = Date.now()
86
if (now > timeout) break // emergency brake
87
- if (now - lastBack > 500) { // after this long time we try again
87
+ if (now - lastBack > 1000) { // after this long time we try again
88
history.back()
89
lastBack = now
90
}