From c6f378b96822c628fb8bb6fcfa71387ec696558b Mon Sep 17 00:00:00 2001 From: Igor Sirotin Date: Tue, 2 May 2023 17:28:11 +0300 Subject: [PATCH] fix(MessageView): Explicit type check for `messageComponent` --- ui/imports/shared/views/chat/MessageView.qml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/ui/imports/shared/views/chat/MessageView.qml b/ui/imports/shared/views/chat/MessageView.qml index ee4c040a76..9af76f1416 100644 --- a/ui/imports/shared/views/chat/MessageView.qml +++ b/ui/imports/shared/views/chat/MessageView.qml @@ -210,8 +210,20 @@ Loader { return gapComponent case Constants.messageContentType.newMessagesMarker: return newMessagesMarkerComponent - default: + case Constants.messageContentType.messageType: + case Constants.messageContentType.stickerType: + case Constants.messageContentType.emojiType: + case Constants.messageContentType.transactionType: + case Constants.messageContentType.imageType: + case Constants.messageContentType.audioType: + case Constants.messageContentType.communityInviteType: + case Constants.messageContentType.discordMessageType: return messageComponent + case Constants.messageContentType.unknownContentType: + // NOTE: We could display smth like "unknown message type, please upgrade Status to see it". + return null + default: + return null } }