mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-22 18:43:29 +00:00
Fix view transition error on Safari (#2715)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user