Skip to content

Commit

Permalink
fix(svelte): don't destroy on server-side
Browse files Browse the repository at this point in the history
ref #3961
  • Loading branch information
nolimits4web committed Apr 5, 2021
1 parent 49e06f9 commit 8a8fb62
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/svelte/swiper.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
});
onDestroy(() => {
if (swiperInstance && !swiperInstance.destroyed) {
if (typeof window !== 'undefined' && swiperInstance && !swiperInstance.destroyed) {
swiperInstance.destroy(true, false);
}
});
Expand Down

0 comments on commit 8a8fb62

Please sign in to comment.