diff --git a/src/script/conversation/ConversationLabelRepository.ts b/src/script/conversation/ConversationLabelRepository.ts index d2e5f63ee14..b743c3a91a5 100644 --- a/src/script/conversation/ConversationLabelRepository.ts +++ b/src/script/conversation/ConversationLabelRepository.ts @@ -72,15 +72,6 @@ export const createLabel = ( type, }); -export const createLabelGroups = (groups: Conversation[] = []) => - createLabel(t('conversationLabelGroups'), groups, DefaultLabelIds.Groups); - -export const createLabelPeople = (contacts: Conversation[] = []) => - createLabel(t('conversationLabelPeople'), contacts, DefaultLabelIds.Contacts); - -export const createLabelFavorites = (favorites: Conversation[] = []) => - createLabel(t('conversationLabelFavorites'), favorites, DefaultLabelIds.Favorites); - export class ConversationLabelRepository extends TypedEventTarget<{type: 'conversation-favorited'}> { labels: ko.ObservableArray; private allLabeledConversations: ko.Computed; diff --git a/src/script/page/LeftSidebar/panels/Conversations/GroupedConversations.tsx b/src/script/page/LeftSidebar/panels/Conversations/GroupedConversations.tsx index 0cc3f1ac966..d60211322d8 100644 --- a/src/script/page/LeftSidebar/panels/Conversations/GroupedConversations.tsx +++ b/src/script/page/LeftSidebar/panels/Conversations/GroupedConversations.tsx @@ -33,8 +33,6 @@ import { ConversationLabel, ConversationLabelRepository, createLabel, - createLabelGroups, - createLabelPeople, } from '../../../../conversation/ConversationLabelRepository'; import type {ConversationRepository} from '../../../../conversation/ConversationRepository'; import {ConversationState} from '../../../../conversation/ConversationState'; @@ -75,7 +73,6 @@ const GroupedConversations: React.FC = ({ callState = container.resolve(CallState), }) => { const {conversationLabelRepository} = conversationRepository; - const {visibleConversations: conversations} = useKoSubscribableChildren(conversationState, ['visibleConversations']); useKoSubscribableChildren(callState, ['activeCalls']); @@ -84,19 +81,11 @@ const GroupedConversations: React.FC = ({ useLabels(conversationLabelRepository); - const groups = conversationLabelRepository.getGroupsWithoutLabel(conversations); - const contacts = conversationLabelRepository.getContactsWithoutLabel(conversations); - const custom = conversationLabelRepository + const folders = conversationLabelRepository .getLabels() .map(label => createLabel(label.name, conversationLabelRepository.getLabelConversations(label), label.id)) .filter(({conversations}) => !!conversations().length); - const folders = [ - ...(groups.length > 0 ? [createLabelGroups(groups)] : []), - ...(contacts.length > 0 ? [createLabelPeople(contacts)] : []), - ...custom, - ]; - return (
    {folders.map(folder => (