Init store only on mount

This commit is contained in:
Vadim
2021-06-29 11:42:18 +03:00
parent 075f3b4b20
commit a7c0de17e5

View File

@@ -109,7 +109,6 @@
children[pageIndex].style.maxWidth = `${pageWidth}px` children[pageIndex].style.maxWidth = `${pageWidth}px`
} }
store.init(initialPageIndex + Number(infinite))
offsetPage(false) offsetPage(false)
} }
@@ -145,6 +144,8 @@
loaded = [0, pagesElement.children.length - 1] loaded = [0, pagesElement.children.length - 1]
await tick() await tick()
infinite && addClones() infinite && addClones()
store.init(initialPageIndex + Number(infinite))
applyPageSizes() applyPageSizes()
} }
applyAutoplay() applyAutoplay()