From 4b5a3b2cae51c8fe5ca18df0162dd702c7e7eeeb Mon Sep 17 00:00:00 2001 From: Gabby Gurdin Date: Mon, 12 Feb 2024 14:25:53 -0500 Subject: [PATCH] get originalsent langcode if original written not available --- lib/pangea/models/pangea_message_event.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/pangea/models/pangea_message_event.dart b/lib/pangea/models/pangea_message_event.dart index 58df14bf77..d4b0dce50f 100644 --- a/lib/pangea/models/pangea_message_event.dart +++ b/lib/pangea/models/pangea_message_event.dart @@ -389,8 +389,10 @@ class PangeaMessageEvent { .isToolEnabled(ToolSetting.immersionMode, room); final String? l2Code = MatrixState.pangeaController.languageController .activeL2Code(roomID: room.id); + final String? originalLangCode = + (originalWritten ?? originalSent)?.langCode; - final String? langCode = immersionMode ? l2Code : originalWritten?.langCode; + final String? langCode = immersionMode ? l2Code : originalLangCode; return langCode ?? LanguageKeys.unknownLanguage; }