about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorHailey <me@haileyok.com>2024-10-07 14:09:47 -0700
committerGitHub <noreply@github.com>2024-10-07 14:09:47 -0700
commitee25b89801c7038a95eb95500082dbccccb5cba9 (patch)
tree265b9380950ffa95d6fbfc8763cb5d6abc3500da /src
parent94e7bfbe40ba6766361caaba99feff74a187613a (diff)
downloadvoidsky-ee25b89801c7038a95eb95500082dbccccb5cba9.tar.zst
[Video] Add dimension info to share intent (#5639)
Diffstat (limited to 'src')
-rw-r--r--src/lib/hooks/useIntentHandler.ts3
-rw-r--r--src/state/shell/composer/index.tsx2
-rw-r--r--src/view/com/composer/Composer.tsx2
3 files changed, 4 insertions, 3 deletions
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])