[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
2 changed files with 23 additions and 9 deletions
+6 -2
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(() => {