Skip to content

Commit

Permalink
Catch the finished promise AbortError and rethrow any error that isn'…
Browse files Browse the repository at this point in the history
…t an AbortError
  • Loading branch information
jaywhy committed Oct 11, 2024
1 parent 08e5776 commit 7c246fe
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/transition.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,13 @@ function nextFrame() {
}

function afterTransition(element) {
return Promise.all(element.getAnimations().map(animation => animation.finished))
return Promise.all(
element.getAnimations().map(animation => {
return animation.finished.catch(e => {
if (e.name !== 'AbortError') {
throw e
}
})
}),
)
}

0 comments on commit 7c246fe

Please sign in to comment.