Skip to content

Commit

Permalink
Revert "fixed delete msg issue"
Browse files Browse the repository at this point in the history
This reverts commit c3648f0.
  • Loading branch information
Bhupesh-mfsi committed Sep 9, 2024
1 parent e98cc2a commit 90e32b2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,6 @@ export const onSubmitMessage = async (
account: Account,
selectedContact: ContactPreview,
) => {
// Message can't be empty if no files are selected & its not DELETE msg.
if (
messageView.actionType !== MessageActionType.DELETE &&
!props.filesSelected.length &&
(!props.message || props.message.trim() === '')
) {
return;
}

if (messageView.actionType === MessageActionType.REPLY) {
const referenceMessageHash =
messageView.messageData?.envelop.metadata?.encryptedMessageHash;
Expand Down
5 changes: 5 additions & 0 deletions packages/messenger-widget/src/hooks/messages/useMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,11 @@ export const useMessage = () => {
message: Message,
): Promise<{ isSuccess: boolean; error?: string }> => {
const contact = normalizeEnsName(_contactName);
//If a message is empty it should not be added

if (!message.message || message.message.trim() === '') {
return { isSuccess: false, error: 'Message is empty' };
}

//Find the recipient of the message in the contact list
const recipient = contacts.find(
Expand Down

0 comments on commit 90e32b2

Please sign in to comment.