Skip to content

Commit

Permalink
really return null on DisabledChatReasons.DEVICE_CHAT
Browse files Browse the repository at this point in the history
  • Loading branch information
r10s committed Apr 8, 2024
1 parent b763949 commit 30b5a6e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/renderer/components/composer/DisabledMessageInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 (
<div className='composer composer--disabled-message-input'>
{reasonMessage}
Expand Down

0 comments on commit 30b5a6e

Please sign in to comment.