From 64924986bf1b95ee3260f2228771c4a237c698ac Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Fri, 9 Sep 2022 11:06:18 -0700 Subject: [PATCH] fix: :bug: Fix slide sync on initial timeline load --- package.json | 2 +- packages/client/src/pages/timeline.vue | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 95a104c25..4e6509716 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/packages/client/src/pages/timeline.vue b/packages/client/src/pages/timeline.vue index adfda93c9..e32902aae 100644 --- a/packages/client/src/pages/timeline.vue +++ b/packages/client/src/pages/timeline.vue @@ -127,7 +127,7 @@ const rootEl = $ref(); 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]); }