diff --git a/app/routes/_app+/recipients+/$recipientId.index.tsx b/app/routes/_app+/recipients+/$recipientId.index.tsx index 042c5c87..dde7d5ea 100644 --- a/app/routes/_app+/recipients+/$recipientId.index.tsx +++ b/app/routes/_app+/recipients+/$recipientId.index.tsx @@ -383,6 +383,7 @@ function MessageForms({ const deleteSafeDelayMs = 150 const [confirmDelete, setConfirmDelete] = useState(false) const [canDelete, setCanDelete] = useState(false) + const [currentContent, setCurrentContent] = useState(message.content) const formRef = useRef(null) const textareaRef = useRef(null) const [updateContentForm, updateContentFields] = useForm({ @@ -408,6 +409,8 @@ function MessageForms({ const sendIsPending = sendNowFetcher.state !== 'idle' const deleteIsPending = deleteFetcher.state !== 'idle' const textareaProps = getTextareaProps(updateContentFields.content) + const hasEdits = currentContent !== message.content + const showSaveButton = hasEdits || updateIsPending useEffect(() => { if (confirmDelete) { @@ -461,19 +464,21 @@ function MessageForms({ {headerText}
- - - Save - + {showSaveButton ? ( + + + Save + + ) : null} { if (!open) setConfirmDelete(false) @@ -532,6 +537,9 @@ function MessageForms({