Init store only on mount
This commit is contained in:
@@ -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()
|
||||||
|
|||||||
Reference in New Issue
Block a user