Disable editing quotes for messages
This commit is contained in:
parent
583a321dd9
commit
320ac044a8
1 changed files with 11 additions and 23 deletions
|
@ -713,6 +713,11 @@ export function setQuoteByMessageId(
|
|||
throw new Error('sendStickerMessage: No conversation found');
|
||||
}
|
||||
|
||||
const draftEditMessage = conversation.get('draftEditMessage');
|
||||
if (draftEditMessage) {
|
||||
return;
|
||||
}
|
||||
|
||||
const message = messageId ? await getMessageById(messageId) : undefined;
|
||||
const state = getState();
|
||||
|
||||
|
@ -752,7 +757,6 @@ export function setQuoteByMessageId(
|
|||
window.Signal.Data.updateConversation(conversation.attributes);
|
||||
}
|
||||
|
||||
const draftEditMessage = conversation.get('draftEditMessage');
|
||||
if (message) {
|
||||
const quote = await makeQuote(message.attributes);
|
||||
|
||||
|
@ -761,31 +765,15 @@ export function setQuoteByMessageId(
|
|||
return;
|
||||
}
|
||||
|
||||
if (draftEditMessage) {
|
||||
conversation.set({
|
||||
draftEditMessage: {
|
||||
...draftEditMessage,
|
||||
quote,
|
||||
},
|
||||
});
|
||||
} else {
|
||||
dispatch(
|
||||
setQuotedMessage(conversationId, {
|
||||
conversationId,
|
||||
quote,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
dispatch(setComposerFocus(conversation.id));
|
||||
dispatch(setComposerDisabledState(conversationId, false));
|
||||
} else if (draftEditMessage) {
|
||||
conversation.set({
|
||||
draftEditMessage: {
|
||||
...draftEditMessage,
|
||||
quote: undefined,
|
||||
},
|
||||
});
|
||||
} else {
|
||||
dispatch(setQuotedMessage(conversationId, undefined));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue