Skip to content

Commit

Permalink
allow only posting video (#5142)
Browse files Browse the repository at this point in the history
  • Loading branch information
mozzius authored Sep 4, 2024
1 parent c36c47d commit e8eaf2f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/view/com/composer/Composer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -238,6 +243,7 @@ export const ComposePost = observer(function ComposePost({
closeAllDialogs,
discardPromptControl,
onClose,
videoUploadState.status,
])

useImperativeHandle(cancelRef, () => ({onPressCancel}))
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e8eaf2f

Please sign in to comment.