add marker for unread messages

This commit is contained in:
marlon-erler
2024-07-27 15:24:50 +02:00
parent 461f607444
commit 5a961b0f74
6 changed files with 68 additions and 5 deletions
+8
View File
@@ -83,6 +83,9 @@ export default class ChatModel {
chatMessage.status = ChatMessageStatus.Received;
this.addMessage(chatMessage);
this.info.hasUnreadMessages = true;
this.storeInfo();
};
handleMessageSent = (chatMessage: ChatMessage): void => {
@@ -171,6 +174,11 @@ export default class ChatModel {
this.connectionModel.addChannel(this.info.primaryChannel);
};
markUnread = (): void => {
this.info.hasUnreadMessages = false;
this.storeInfo();
}
// storage
storeInfo = (): void => {
this.storageModel.writeStringifiable(this.getInfoPath(), this.info);