Skip to content

Commit 8e0ff07

Browse files
Simplify translation key detection in ExpandableMessage component
This commit further refines the error message display by: 1. Removing redundant check for message === id since isMessageTranslationKey already handles this case 2. Simplifying the condition for displaying translated messages These changes make the code more maintainable and easier to understand.
1 parent b7582b3 commit 8e0ff07

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

frontend/src/components/features/chat/expandable-message.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ export function ExpandableMessage({
4343
if (id && i18n.exists(id)) {
4444
setHeadline(t(id));
4545

46-
// If the message is the same as the ID or is itself a translation key
47-
if (message === id || isMessageTranslationKey) {
46+
// If the message is a translation key
47+
if (isMessageTranslationKey) {
4848
// Set details to the translated message instead of empty string
4949
// This ensures we show the proper translated text
5050
setDetails(t(id));

0 commit comments

Comments
 (0)