diff options
author | Hailey <me@haileyok.com> | 2024-09-26 12:37:51 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-26 12:37:51 -0700 |
commit | 7ee67e4e7e10a808f8e885efea4caf0465ee9619 (patch) | |
tree | 871ffa8fad2b864a67da4a067b50c50a932ad998 /src/lib | |
parent | 175df72972343795a67be208e58edb02267e1ced (diff) | |
download | voidsky-7ee67e4e7e10a808f8e885efea4caf0465ee9619.tar.zst |
[Share Extension] Move away from deprecated API, implement JS side of things (#5509)
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/hooks/useIntentHandler.ts | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/src/lib/hooks/useIntentHandler.ts b/src/lib/hooks/useIntentHandler.ts index fd1638703..ce1d474d3 100644 --- a/src/lib/hooks/useIntentHandler.ts +++ b/src/lib/hooks/useIntentHandler.ts @@ -1,11 +1,11 @@ import React from 'react' import * as Linking from 'expo-linking' -import {logEvent} from 'lib/statsig/statsig' -import {isNative} from 'platform/detection' -import {useSession} from 'state/session' -import {useComposerControls} from 'state/shell' -import {useCloseAllActiveElements} from 'state/util' +import {logEvent} from '#/lib/statsig/statsig' +import {isNative} from '#/platform/detection' +import {useSession} from '#/state/session' +import {useComposerControls} from '#/state/shell' +import {useCloseAllActiveElements} from '#/state/util' import {useIntentDialogs} from '#/components/intents/IntentDialogs' import {Referrer} from '../../../modules/expo-bluesky-swiss-army' @@ -52,6 +52,7 @@ export function useIntentHandler() { composeIntent({ text: params.get('text'), imageUrisStr: params.get('imageUris'), + videoUri: params.get('videoUri'), }) return } @@ -80,14 +81,25 @@ export function useComposeIntent() { ({ text, imageUrisStr, + videoUri, }: { text: string | null - imageUrisStr: string | null // unused for right now, will be used later with intents + imageUrisStr: string | null + videoUri: string | null }) => { if (!hasSession) return closeAllActiveElements() + // Whenever a video URI is present, we don't support adding images right now. + if (videoUri) { + openComposer({ + text: text ?? undefined, + videoUri, + }) + return + } + const imageUris = imageUrisStr ?.split(',') .filter(part => { |