Fix view transition error on Safari (#2715)

This commit is contained in:
Greg Bergé
2025-01-10 07:27:49 +01:00
committed by GitHub
parent d8763997a5
commit 6b503608cd
2 changed files with 9 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'gitbook': patch
---
Fix view transition error on Safari
@@ -281,7 +281,10 @@ function startViewTransition(callback: () => void, onEnd?: () => void) {
});
} catch (error) {
// Safari can throw an error if another transition is already in progress
if (error instanceof Error && error.name === 'AbortError') {
if (
error instanceof Error &&
(error.name === 'AbortError' || error.name === 'InvalidStateError')
) {
callback();
onEnd?.();
return;