Page MenuHomePhabricator

D7971.diff
No OneTemporary

D7971.diff

diff --git a/web/chat/edit-text-message.react.js b/web/chat/edit-text-message.react.js
--- a/web/chat/edit-text-message.react.js
+++ b/web/chat/edit-text-message.react.js
@@ -45,6 +45,11 @@
[threadColor],
);
+ const isMessageEmpty = React.useMemo(
+ () => trimMessage(editedMessageDraft) === '',
+ [editedMessageDraft],
+ );
+
const isMessageEdited = React.useMemo(() => {
const { messageInfo } = item;
if (!messageInfo || !messageInfo.text || !editState) {
@@ -59,6 +64,9 @@
const checkAndEdit = async () => {
const { id: messageInfoID } = item.messageInfo;
+ if (isMessageEmpty) {
+ return;
+ }
if (!isMessageEdited) {
clearEditModal();
return;
@@ -149,6 +157,7 @@
variant="filled"
buttonColor={saveButtonColor}
onClick={checkAndEdit}
+ disabled={isMessageEmpty}
>
Save (enter)
</Button>

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 24, 12:03 PM (20 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2575501
Default Alt Text
D7971.diff (947 B)

Event Timeline