From 30b5a6e954262f973863237f268b657aec229a6a Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Mon, 8 Apr 2024 12:45:37 +0200 Subject: [PATCH] really return null on DisabledChatReasons.DEVICE_CHAT --- .../components/composer/DisabledMessageInput.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/renderer/components/composer/DisabledMessageInput.tsx b/src/renderer/components/composer/DisabledMessageInput.tsx index 3edcf08a46..42384a9ddf 100644 --- a/src/renderer/components/composer/DisabledMessageInput.tsx +++ b/src/renderer/components/composer/DisabledMessageInput.tsx @@ -19,8 +19,8 @@ const DisabledMessageInput = ({ reason }: Props) => { case DisabledChatReasons.DEADDROP: return tx('messaging_disabled_deaddrop') case DisabledChatReasons.DEVICE_CHAT: - // To not clutter UI, if we're in the "device message" chat we also do not want to show anything - return null + // no call to tx(), the bar will be removed below to no clutter UI + return 'messaging_disabled_device_chat' case DisabledChatReasons.UNKNOWN: // Unknown cases are likely to be caused by a new case introduced by a new core update that is not yet handled here, // but we don't want to crash the UI @@ -35,6 +35,11 @@ const DisabledMessageInput = ({ reason }: Props) => { return null } + // If we're in the "device message" chat we also do not want to show anything + if (reason === DisabledChatReasons.DEVICE_CHAT) { + return null + } + return (
{reasonMessage}