From 926bd25a4046aaeceb7711513550509af4326fe6 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Thu, 15 Sep 2022 14:00:50 -0700 Subject: [PATCH] .3 --- package.json | 2 +- packages/client/src/pages/about.vue | 7 ++++++- packages/client/src/pages/admin-file.vue | 7 ++++++- packages/client/src/pages/gallery/index.vue | 7 ++++++- packages/client/src/pages/instance-info.vue | 7 ++++++- packages/client/src/pages/notifications.vue | 7 ++++++- packages/client/src/pages/user/index.vue | 7 ++++++- 7 files changed, 37 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index b5cbda9d24..1500ce882a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "calckey", - "version": "12.119.0-calc.1-rc.2", + "version": "12.119.0-calc.1-rc.3", "codename": "aqua", "repository": { "type": "git", diff --git a/packages/client/src/pages/about.vue b/packages/client/src/pages/about.vue index d506cd3272..c373534d66 100644 --- a/packages/client/src/pages/about.vue +++ b/packages/client/src/pages/about.vue @@ -120,8 +120,13 @@ const props = withDefaults(defineProps<{ }); let stats = $ref(null); -let tab = $ref(props.initialTab); let tabs = ['overview', 'emojis','charts']; +let tab = $computed({ + get: () => props.initialTab, + set: (x) => { + syncSlide(tabs.indexOf(x)); + }, +}); if (iAmModerator) tabs.push('federation'); const initStats = () => os.api('stats', { diff --git a/packages/client/src/pages/admin-file.vue b/packages/client/src/pages/admin-file.vue index 26aa62e35a..ff3b52de73 100644 --- a/packages/client/src/pages/admin-file.vue +++ b/packages/client/src/pages/admin-file.vue @@ -99,10 +99,15 @@ import { defaultStore } from '@/store'; import 'swiper/scss'; import 'swiper/scss/virtual'; -let tab = $ref('overview'); let tabs = ['overview']; if (iAmModerator) tabs.push('ip'); tabs.push('raw'); +let tab = $computed({ + get: () => tabs[0], + set: (x) => { + syncSlide(tabs.indexOf(x)); + }, +}); let file: any = $ref(null); let info: any = $ref(null); let isSensitive: boolean = $ref(false); diff --git a/packages/client/src/pages/gallery/index.vue b/packages/client/src/pages/gallery/index.vue index a1e275e7a1..3a01f3db49 100644 --- a/packages/client/src/pages/gallery/index.vue +++ b/packages/client/src/pages/gallery/index.vue @@ -69,8 +69,13 @@ const props = defineProps<{ tag?: string; }>(); -let tab = $ref('explore'); const tabs = ['explore', 'liked', 'my']; +let tab = $computed({ + get: () => tabs[0], + set: (x) => { + syncSlide(tabs.indexOf(x)); + }, +}); let tagsRef = $ref(); const recentPostsPagination = { diff --git a/packages/client/src/pages/instance-info.vue b/packages/client/src/pages/instance-info.vue index 5c33d7793c..52497172f0 100644 --- a/packages/client/src/pages/instance-info.vue +++ b/packages/client/src/pages/instance-info.vue @@ -162,9 +162,14 @@ const props = defineProps<{ host: string; }>(); -let tab = $ref('overview'); let tabs = ['overview']; if (iAmModerator) tabs.push('chart', 'users', 'raw'); +let tab = $computed({ + get: () => tabs[0], + set: (x) => { + syncSlide(tabs.indexOf(x)); + }, +}); let chartSrc = $ref('instance-requests'); let meta = $ref(null); let instance = $ref(null); diff --git a/packages/client/src/pages/notifications.vue b/packages/client/src/pages/notifications.vue index e1b25533db..4319a7a8ea 100644 --- a/packages/client/src/pages/notifications.vue +++ b/packages/client/src/pages/notifications.vue @@ -49,8 +49,13 @@ import { defaultStore } from '@/store'; import 'swiper/scss'; import 'swiper/scss/virtual'; -let tab = $ref('all'); const tabs = ['all', 'unread', 'mentions', 'directNotes']; +let tab = $computed({ + get: () => tabs[0], + set: (x) => { + syncSlide(tabs.indexOf(x)); + }, +}); let includeTypes = $ref(null); let unreadOnly = $computed(() => tab === 'unread'); os.api('notifications/mark-all-as-read'); diff --git a/packages/client/src/pages/user/index.vue b/packages/client/src/pages/user/index.vue index a59ace0ed4..dd932b8c0c 100644 --- a/packages/client/src/pages/user/index.vue +++ b/packages/client/src/pages/user/index.vue @@ -67,7 +67,6 @@ const props = withDefaults(defineProps<{ const router = useRouter(); -let tab = $ref(props.page); let tabs = ['home']; let user = $ref(null); if (($i && ($i.id === user?.id)) || user?.publicReactions) { @@ -76,6 +75,12 @@ if (($i && ($i.id === user?.id)) || user?.publicReactions) { if ((user?.instance != null)) { tabs.push('clips', 'pages', 'gallery'); } +let tab = $computed({ + get: () => tabs[0], + set: (x) => { + syncSlide(tabs.indexOf(x)); + }, +}); let error = $ref(null); function fetchUser(): void {