From e3e95e86fa4571a45ad036bcc213413624f7bdd7 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Mon, 5 Sep 2022 18:34:48 -0700 Subject: [PATCH] lfg --- package.json | 2 +- packages/client/src/pages/timeline.vue | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index b3a9084104..bc45cab21c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "calckey", - "version": "12.118.1-calc.2-beta.2-rc.7", + "version": "12.118.1-calc.2-beta.2-rc.8", "codename": "aqua", "repository": { "type": "git", diff --git a/packages/client/src/pages/timeline.vue b/packages/client/src/pages/timeline.vue index ac4922c857..7e06946758 100644 --- a/packages/client/src/pages/timeline.vue +++ b/packages/client/src/pages/timeline.vue @@ -114,7 +114,11 @@ const rootEl = $ref(); let queue = $ref(0); const src = $computed({ get: () => defaultStore.reactiveState.tl.value.src, - set: (x) => saveSrc(x), + set: (x) => { + saveSrc(x); + console.log('set src', x); + syncSlide(x); + }, }); watch($$(src), () => (queue = 0)); @@ -277,11 +281,11 @@ function setSwiperRef(swiper) { } function onSlideChange() { - if (swiperRef) { - const index = swiperRef.activeIndex; - saveSrc(timelines[swiperRef.activeIndex]); - swiperRef.slideTo(index - 1, 0); - } + saveSrc(timelines[swiperRef.activeIndex]); +} + +function syncSlide(index) { + swiperRef.slideTo(index); }