diff --git a/packages/pl-fe/src/features/compose/components/compose-form.tsx b/packages/pl-fe/src/features/compose/components/compose-form.tsx index 8335f7a4db..8bc10ec684 100644 --- a/packages/pl-fe/src/features/compose/components/compose-form.tsx +++ b/packages/pl-fe/src/features/compose/components/compose-form.tsx @@ -183,11 +183,12 @@ const ComposeForm = ({ id, shouldCondense, autoFocus, clickab ), [features, id, anyMedia]); - const composeModifiers = !condensed && ( + const showModifiers = !condensed && (compose.media_attachments.size || compose.is_uploading || compose.poll?.options.size || compose.schedule); + + const composeModifiers = showModifiers && ( - ); @@ -228,7 +229,7 @@ const ComposeForm = ({ id, shouldCondense, autoFocus, clickab {!shouldCondense && !event && !group && } {!!selectButtons && ( - + {selectButtons} )} diff --git a/packages/pl-fe/src/features/compose/components/upload-form.tsx b/packages/pl-fe/src/features/compose/components/upload-form.tsx index 5cb19cacb6..d33ad510de 100644 --- a/packages/pl-fe/src/features/compose/components/upload-form.tsx +++ b/packages/pl-fe/src/features/compose/components/upload-form.tsx @@ -16,7 +16,9 @@ interface IUploadForm { const UploadForm: React.FC = ({ composeId, onSubmit }) => { const dispatch = useAppDispatch(); - const mediaIds = useCompose(composeId).media_attachments.map((item) => item.id); + const { is_uploading: isUploading, media_attachments: mediaAttachments } = useCompose(composeId); + + const mediaIds = mediaAttachments.map((item) => item.id); const dragItem = useRef(); const dragOverItem = useRef(); @@ -35,11 +37,13 @@ const UploadForm: React.FC = ({ composeId, onSubmit }) => { dragOverItem.current = null; }, [dragItem, dragOverItem]); + if (!isUploading && mediaIds.isEmpty()) return null; + return (
- + {mediaIds.map((id: string) => (