Fix check before closing

This commit is contained in:
Lim Chee Aun 2022-12-12 21:58:02 +08:00
parent 5353a4535a
commit ad8ae165a6

View file

@ -199,7 +199,7 @@ export default ({ onClose, replyToStatus, editStatus }) => {
mediaAttachments.length > 0 && mediaAttachments.length > 0 &&
mediaAttachments.some((media) => !media.id); mediaAttachments.some((media) => !media.id);
if (value !== dataset?.source || containNonIDMediaAttachments) { if ((value && value !== dataset?.source) || containNonIDMediaAttachments) {
const yes = confirm(beforeUnloadCopy); const yes = confirm(beforeUnloadCopy);
return yes; return yes;
} }