From 33f0f213999f9fb19876b7622c45be08e2f871d0 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Wed, 21 Dec 2022 01:03:24 +0800 Subject: [PATCH] My sense of logic is getting worse --- src/components/compose.jsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/compose.jsx b/src/components/compose.jsx index 248b80ed..120b79e5 100644 --- a/src/components/compose.jsx +++ b/src/components/compose.jsx @@ -256,6 +256,12 @@ function Compose({ const canClose = () => { const { value, dataset } = textareaRef.current; + // check if loading + if (uiState === 'loading') { + console.log('canClose', { uiState }); + return false; + } + // check for status and media attachments const hasMediaAttachments = mediaAttachments.length > 0; if (!value && !hasMediaAttachments) { @@ -289,12 +295,6 @@ function Compose({ return true; } - // check if loading - if (uiState !== 'loading') { - console.log('canClose', { uiState }); - return true; - } - console.log('canClose', { value, hasMediaAttachments,