From ee25b89801c7038a95eb95500082dbccccb5cba9 Mon Sep 17 00:00:00 2001 From: Hailey Date: Mon, 7 Oct 2024 14:09:47 -0700 Subject: [Video] Add dimension info to share intent (#5639) --- src/lib/hooks/useIntentHandler.ts | 3 ++- src/state/shell/composer/index.tsx | 2 +- src/view/com/composer/Composer.tsx | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/lib/hooks/useIntentHandler.ts b/src/lib/hooks/useIntentHandler.ts index ce1d474d3..98ba4ec02 100644 --- a/src/lib/hooks/useIntentHandler.ts +++ b/src/lib/hooks/useIntentHandler.ts @@ -93,9 +93,10 @@ export function useComposeIntent() { // Whenever a video URI is present, we don't support adding images right now. if (videoUri) { + const [uri, width, height] = videoUri.split('|') openComposer({ text: text ?? undefined, - videoUri, + videoUri: {uri, width: Number(width), height: Number(height)}, }) return } diff --git a/src/state/shell/composer/index.tsx b/src/state/shell/composer/index.tsx index 1c3aa6a81..770b0789e 100644 --- a/src/state/shell/composer/index.tsx +++ b/src/state/shell/composer/index.tsx @@ -38,7 +38,7 @@ export interface ComposerOpts { openEmojiPicker?: (pos: DOMRect | undefined) => void text?: string imageUris?: {uri: string; width: number; height: number; altText?: string}[] - videoUri?: string + videoUri?: {uri: string; width: number; height: number} } type StateContext = ComposerOpts | undefined diff --git a/src/view/com/composer/Composer.tsx b/src/view/com/composer/Composer.tsx index 94c02767e..0189ca9a8 100644 --- a/src/view/com/composer/Composer.tsx +++ b/src/view/com/composer/Composer.tsx @@ -218,7 +218,7 @@ export const ComposePost = ({ // Whenever we receive an initial video uri, we should immediately run compression if necessary useEffect(() => { if (initVideoUri) { - selectVideo({uri: initVideoUri} as ImagePickerAsset) + selectVideo(initVideoUri) } }, [initVideoUri, selectVideo]) -- cgit 1.4.1