Skip to content

Commit

Permalink
fix: always allow to edit the draft if it is not empty
Browse files Browse the repository at this point in the history
Otherwise if you leave the group or get removed from the group,
the draft stays forever and is shown in summary,
but it is not possible to edit it or get rid of it.
  • Loading branch information
link2xt committed Nov 14, 2024
1 parent 5bfd011 commit 25669b1
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions packages/frontend/src/components/composer/Composer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ const Composer = forwardRef<
</button>
</div>
)
} else if (!selectedChat.canSend) {
} else if (!selectedChat.canSend && draftState.text === '') {
return null
} else {
return (
Expand Down Expand Up @@ -377,12 +377,14 @@ const Composer = forwardRef<
>
<span />
</button>
<div className='send-button-wrapper' onClick={composerSendMessage}>
<button
aria-label={tx('menu_send')}
aria-keyshortcuts={ariaSendShortcut}
/>
</div>
{selectedChat.canSend && (
<div className='send-button-wrapper' onClick={composerSendMessage}>
<button
aria-label={tx('menu_send')}
aria-keyshortcuts={ariaSendShortcut}
/>
</div>
)}
</div>
{showEmojiPicker && (
<EmojiAndStickerPicker
Expand Down

0 comments on commit 25669b1

Please sign in to comment.