From fc235024aa2d47813d2fc016b2796c03068c0b30 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Thu, 15 Dec 2022 13:03:20 +0800 Subject: [PATCH] Handle pop-in case when there's already a Compose field open Show confirmation first before popping-in --- src/components/compose.jsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/components/compose.jsx b/src/components/compose.jsx index 0d2f533..5694477 100644 --- a/src/components/compose.jsx +++ b/src/components/compose.jsx @@ -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, );