1
0
Fork 0

My sense of logic is getting worse

This commit is contained in:
Lim Chee Aun 2022-12-21 01:03:24 +08:00
parent b7c5dce372
commit 33f0f21399

View file

@ -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,