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); +} +