From 51af59dfc549ea926abe41263880c029a68f1868 Mon Sep 17 00:00:00 2001 From: mattyatea Date: Tue, 12 Mar 2024 23:18:11 +0900 Subject: [PATCH] fix: channel timeline post form --- packages/frontend/src/components/MkTimeline.vue | 2 +- packages/frontend/src/pages/timeline.vue | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/frontend/src/components/MkTimeline.vue b/packages/frontend/src/components/MkTimeline.vue index d52d34ce2d..9ef20732d8 100644 --- a/packages/frontend/src/components/MkTimeline.vue +++ b/packages/frontend/src/components/MkTimeline.vue @@ -29,7 +29,7 @@ import { defaultStore } from '@/store.js'; import { Paging } from '@/components/MkPagination.vue'; const props = withDefaults(defineProps<{ - src: 'home' | 'local' | 'social' | 'global' | 'mentions' | 'directs' | 'list' | 'antenna' | 'channel' | 'role'; + src: 'home' | 'local' | 'social' | 'global' | 'mentions' | 'directs' | 'list' | 'antenna' | 'channel' | 'role' | 'media'; list?: string; antenna?: string; channel?: string; diff --git a/packages/frontend/src/pages/timeline.vue b/packages/frontend/src/pages/timeline.vue index 445bb18d73..44283f0eb2 100644 --- a/packages/frontend/src/pages/timeline.vue +++ b/packages/frontend/src/pages/timeline.vue @@ -7,6 +7,7 @@ SPDX-License-Identifier: AGPL-3.0-only + {{ channelInfo ? channelInfo.name : '' }}
@@ -68,7 +69,7 @@ const rootEl = shallowRef(); const queue = ref(0); const srcWhenNotSignin = ref<'local' | 'global'>(isLocalTimelineAvailable ? 'local' : 'global'); -const src = computed<'home' | 'local' | 'social' | 'global' | `list:${string}`>({ +const src = computed<'home' | 'local' | 'social' | 'global' | `list:${string}`| `channel:${string}`>({ get: () => ($i ? defaultStore.reactiveState.tl.value.src : srcWhenNotSignin.value), set: (x) => saveSrc(x), }); @@ -127,13 +128,14 @@ const showSocialTimeline = ref(defaultStore.state.showSocialTimeline); const channelInfo = ref(); if (src.value.split(':')[0] === 'channel') { const channelId = src.value.split(':')[1]; - channelInfo.value = misskeyApi('channels/show', { channelId }); + channelInfo.value = await misskeyApi('channels/show', { channelId }); } watch(src, async () => { queue.value = 0; + if (src.value.split(':')[0] === 'channel') { const channelId = src.value.split(':')[1]; - channelInfo.value = misskeyApi('channels/show', { channelId }); + channelInfo.value = await misskeyApi('channels/show', { channelId }); } else { channelInfo.value = null; }