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