Handle pop-in case when there's already a Compose field open

Show confirmation first before popping-in
This commit is contained in:
Lim Chee Aun 2022-12-15 13:03:20 +08:00
parent b987b525ef
commit fc235024aa

View file

@ -408,6 +408,13 @@ function Compose({
return;
}
if (window.opener.__STATES__.showCompose) {
const yes = confirm(
'Looks like you already have a compose field open in the parent window. Popping in this window will discard the changes you made in the parent window. Continue?',
);
if (!yes) return;
}
const mediaAttachmentsWithIDs = mediaAttachments.filter(
(media) => media.id,
);