From 9f3af0afa7bbeac7052e57c7301f6b541899f01d Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Sun, 6 Nov 2022 13:20:28 -0800 Subject: [PATCH] fix??? --- package.json | 2 +- .../client/src/components/MkChatPreview.vue | 2 +- packages/client/src/pages/messaging/index.vue | 46 +++++++++---------- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/package.json b/package.json index a483affcae..3584708089 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "calckey", - "version": "12.119.0-calc.8-rc.3", + "version": "12.119.0-calc.8-rc.4", "codename": "aqua", "repository": { "type": "git", diff --git a/packages/client/src/components/MkChatPreview.vue b/packages/client/src/components/MkChatPreview.vue index 209f8ef1cc..19a5bf2df0 100644 --- a/packages/client/src/components/MkChatPreview.vue +++ b/packages/client/src/components/MkChatPreview.vue @@ -14,7 +14,7 @@ )}` " > -
+
{{ i18n.ts.startMessaging }} - +
Info @@ -24,10 +24,10 @@
+ {{ i18n.ts.startMessaging }} + {{ i18n.ts.manageGroups }} - {{ i18n.ts.startMessaging }} - {{ i18n.ts.manageGroups }} - +
@@ -60,6 +60,10 @@ const router = useRouter(); let messages = $ref([]); let connection = $ref(null); +const tabs = ['dms', 'groups']; +let tab = $ref(tabs[0]); +watch($$(tab), () => (syncSlide(tabs.indexOf(tab)))); + const dmsPagination = { endpoint: 'messaging/history' as const, limit: 15, @@ -75,10 +79,6 @@ const groupsPagination = { }, }; -const tabs = ['dms', 'groups']; -let tab = $ref(tabs[0]); -watch($$(tab), () => (syncSlide(tabs.indexOf(tab)))); - const headerActions = $computed(() => []); const headerTabs = $computed(() => [{ @@ -96,21 +96,6 @@ definePageMetadata({ icon: 'fas fa-comments', }); -let swiperRef = null; - -function setSwiperRef(swiper) { - swiperRef = swiper; - syncSlide(tabs.indexOf(tab)); -} - -function onSlideChange() { - tab = tabs[swiperRef.activeIndex]; -} - -function syncSlide(index) { - swiperRef.slideTo(index); -} - function onMessage(message) { if (message.recipientId) { messages = messages.filter(m => !( @@ -184,6 +169,21 @@ onUnmounted(() => { if (connection) connection.dispose(); }); +let swiperRef = null; + +function setSwiperRef(swiper) { + swiperRef = swiper; + syncSlide(tabs.indexOf(tab)); +} + +function onSlideChange() { + tab = tabs[swiperRef.activeIndex]; +} + +function syncSlide(index) { + swiperRef.slideTo(index); +} +