about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorSamuel Newman <mozzius@protonmail.com>2024-09-04 19:42:28 +0100
committerGitHub <noreply@github.com>2024-09-04 19:42:28 +0100
commite8eaf2f4a72f9c2c45299637425ebc299079caf0 (patch)
tree3e5efe9cf8287f824fadbff5c812c30956d4f513 /src
parentc36c47d49aff74f8a4176db0db6a13de141f5d95 (diff)
downloadvoidsky-e8eaf2f4a72f9c2c45299637425ebc299079caf0.tar.zst
allow only posting video (#5142)
Diffstat (limited to 'src')
-rw-r--r--src/view/com/composer/Composer.tsx11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/view/com/composer/Composer.tsx b/src/view/com/composer/Composer.tsx
index a6eadd251..6a6ac7267 100644
--- a/src/view/com/composer/Composer.tsx
+++ b/src/view/com/composer/Composer.tsx
@@ -224,7 +224,12 @@ export const ComposePost = observer(function ComposePost({
   )
 
   const onPressCancel = useCallback(() => {
-    if (graphemeLength > 0 || !gallery.isEmpty || extGif) {
+    if (
+      graphemeLength > 0 ||
+      !gallery.isEmpty ||
+      extGif ||
+      videoUploadState.status !== 'idle'
+    ) {
       closeAllDialogs()
       Keyboard.dismiss()
       discardPromptControl.open()
@@ -238,6 +243,7 @@ export const ComposePost = observer(function ComposePost({
     closeAllDialogs,
     discardPromptControl,
     onClose,
+    videoUploadState.status,
   ])
 
   useImperativeHandle(cancelRef, () => ({onPressCancel}))
@@ -332,7 +338,8 @@ export const ComposePost = observer(function ComposePost({
         richtext.text.trim().length === 0 &&
         gallery.isEmpty &&
         !extLink &&
-        !quote
+        !quote &&
+        videoUploadState.status === 'idle'
       ) {
         setError(_(msg`Did you want to say anything?`))
         return