From 78bfc4ce00bae3482d419ca6a355ee79981c3bcd Mon Sep 17 00:00:00 2001 From: Takeno-hito <18237819+Takeno-hito@users.noreply.github.com> Date: Fri, 21 Jun 2024 15:55:10 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=E3=81=8A=E6=B0=97=E3=81=AB=E5=85=A5?= =?UTF-8?q?=E3=82=8A=E3=83=81=E3=83=A3=E3=83=B3=E3=83=8D=E3=83=AB=E3=81=AF?= =?UTF-8?q?=E6=9C=AA=E8=AA=AD=E3=81=A7=E5=88=A5=E3=81=AB=E8=A1=A8=E7=A4=BA?= =?UTF-8?q?=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=97?= =?UTF-8?q?=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../NavigationBar/NavigationContent/HomeTab.vue | 16 +++++++++++++--- .../subscription/useChannelsWithNotification.ts | 14 ++++++++++++-- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/components/Main/NavigationBar/NavigationContent/HomeTab.vue b/src/components/Main/NavigationBar/NavigationContent/HomeTab.vue index 515d2eff6..676ab1dfd 100644 --- a/src/components/Main/NavigationBar/NavigationContent/HomeTab.vue +++ b/src/components/Main/NavigationBar/NavigationContent/HomeTab.vue @@ -7,16 +7,26 @@ > + + + - + { return filterTrees(trees, channel => !channel.archived) }) -const { channelsWithNotification, dmChannelsWithNotification } = +const { notStarredChannelsWithNotification, starredChannelsWithNotification, dmChannelsWithNotification } = useChannelsWithNotification() const topLevelChannels = computed(() => diff --git a/src/composables/subscription/useChannelsWithNotification.ts b/src/composables/subscription/useChannelsWithNotification.ts index 59ef1be6c..c98bdcacb 100644 --- a/src/composables/subscription/useChannelsWithNotification.ts +++ b/src/composables/subscription/useChannelsWithNotification.ts @@ -2,10 +2,12 @@ import { computed } from 'vue' import { isDefined } from '/@/lib/basic/array' import { useSubscriptionStore } from '/@/store/domain/subscription' import { useChannelsStore } from '/@/store/entities/channels' +import {useStaredChannels} from "/@/store/domain/staredChannels"; const useChannelsWithNotification = () => { const { unreadChannelsMap } = useSubscriptionStore() const { channelsMap, dmChannelsMap } = useChannelsStore() + const starredChannelStore = useStaredChannels(); const sortedUnreadChannels = computed(() => [...unreadChannelsMap.value.values()].sort((a, b) => { @@ -16,10 +18,18 @@ const useChannelsWithNotification = () => { }) ) - const channelsWithNotification = computed(() => + const notStarredChannelsWithNotification = computed(() => sortedUnreadChannels.value .map(unread => channelsMap.value.get(unread.channelId)) .filter(isDefined) + .filter(channel => !starredChannelStore.staredChannelSet.value.has(channel.id)) + ) + + const starredChannelsWithNotification = computed(() => + sortedUnreadChannels.value + .map(unread => channelsMap.value.get(unread.channelId)) + .filter(isDefined) + .filter(channel => starredChannelStore.staredChannelSet.value.has(channel.id)) ) const dmChannelsWithNotification = computed(() => @@ -28,7 +38,7 @@ const useChannelsWithNotification = () => { .filter(isDefined) ) - return { channelsWithNotification, dmChannelsWithNotification } + return { notStarredChannelsWithNotification, starredChannelsWithNotification, dmChannelsWithNotification } } export default useChannelsWithNotification