From 86e69132c643a4cbbe2bf68a9a5bb46e439bfb97 Mon Sep 17 00:00:00 2001 From: Eric Mastro Date: Mon, 19 Apr 2021 20:49:33 +1000 Subject: [PATCH] feat: add error handling to mark messages as seen logic --- src/app/chat/view.nim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/chat/view.nim b/src/app/chat/view.nim index cbf4b0f67b..5396a78c8e 100644 --- a/src/app/chat/view.nim +++ b/src/app/chat/view.nim @@ -546,7 +546,11 @@ QtObject: proc markMessageAsSent*(self:ChatsView, chat: string, messageId: string) = - self.messageList[chat].markMessageAsSent(messageId) + if self.messageList.contains(chat): + self.messageList[chat].markMessageAsSent(messageId) + else: + error "Message could not be marked as sent", chat, messageId + proc getMessageList(self: ChatsView): QVariant {.slot.} = self.upsertChannel(self.activeChannel.id)