fix: 🐛 Fix slide sync on initial timeline load
This commit is contained in:
parent
f08c04cdb1
commit
11a5a99a6f
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "calckey",
|
||||
"version": "12.118.1-calc.2-beta.2-rc.17",
|
||||
"version": "12.118.1-calc.2-rc.18",
|
||||
"codename": "aqua",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
|
@ -127,7 +127,7 @@ const rootEl = $ref<HTMLElement>();
|
|||
|
||||
let queue = $ref(0);
|
||||
const src = $computed({
|
||||
get: () => defaultStore.reactiveState.tl.value.src,
|
||||
get: () => getSrc(),
|
||||
set: (x) => {
|
||||
saveSrc(x);
|
||||
syncSlide(timelines.indexOf(x));
|
||||
|
@ -278,6 +278,12 @@ function setSwiperRef(swiper) {
|
|||
swiperRef = swiper;
|
||||
}
|
||||
|
||||
function getSrc(): 'home' | 'local' | 'recommended' | 'social' | 'global' {
|
||||
const dSrc = defaultStore.state.tl.src;
|
||||
syncSlide(dSrc);
|
||||
return dSrc;
|
||||
}
|
||||
|
||||
function onSlideChange() {
|
||||
saveSrc(timelines[swiperRef.activeIndex]);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue