add navigation for chat page

This commit is contained in:
marlon-erler
2024-07-20 14:16:26 +02:00
parent 6b269719a1
commit c4aa95d427
13 changed files with 260 additions and 57 deletions
+2 -7
View File
@@ -17,18 +17,13 @@ export default class ChatListModel {
createChat = (primaryChannel: string): ChatModel => {
const id: string = v4();
const chatModel = new ChatModel(this.storageModel, id);
const chatModel = new ChatModel(this.storageModel, this, id);
chatModel.setPrimaryChannel(primaryChannel);
this.addChatModel(chatModel);
return chatModel;
};
deleteChat = (chat: ChatModel): void => {
chat.remove();
this.untrackChat(chat);
};
untrackChat = (chat: ChatModel): void => {
this.chatModels.delete(chat.id);
};
@@ -38,7 +33,7 @@ export default class ChatListModel {
const chatDir = storageKeys.chats;
const chatIds = this.storageModel.list(chatDir);
for (const chatId of chatIds) {
const chatModel = new ChatModel(this.storageModel, chatId);
const chatModel = new ChatModel(this.storageModel, this, chatId);
this.addChatModel(chatModel);
}
};