[Video] Allow drag-and-drop & pasting video (#5252)

* allow DnD/pasting video

* rm await
This commit is contained in:
Samuel Newman 2024-09-10 16:14:28 +01:00 committed by GitHub
parent 6bc5a05f4b
commit 08f5f37b34
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 23 additions and 9 deletions

View file

@ -303,9 +303,13 @@ export const ComposePost = observer(function ComposePost({
const onPhotoPasted = useCallback(
async (uri: string) => {
track('Composer:PastedPhotos')
await gallery.paste(uri)
if (uri.startsWith('data:video/')) {
selectVideo({uri, type: 'video', height: 0, width: 0})
} else {
await gallery.paste(uri)
}
},
[gallery, track],
[gallery, track, selectVideo],
)
const isAltTextRequiredAndMissing = useMemo(() => {