Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Share Extension] Move away from deprecated API, implement JS side of things #5509

Merged
merged 3 commits into from
Sep 26, 2024

Conversation

haileyok
Copy link
Contributor

No description provided.

@arcalinea arcalinea temporarily deployed to hailey/finish-intent-video - social-app PR #5509 September 26, 2024 18:57 — with Render Destroyed
Comment on lines 151 to 156
while responder != nil {
if let application = responder as? UIApplication {
return application.perform(#selector(openURL(_:)), with: url) != nil
application.open(url)
return true
}
responder = responder?.next
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

openURL is deprecated now, we'll just use application.open() instead.

@arcalinea arcalinea temporarily deployed to hailey/finish-intent-video - social-app PR #5509 September 26, 2024 18:59 — with Render Destroyed
@arcalinea arcalinea temporarily deployed to hailey/finish-intent-video - social-app PR #5509 September 26, 2024 18:59 — with Render Destroyed
Copy link

Old size New size Diff
9.97 MB 9.97 MB 220 B (0.00%)

Comment on lines 241 to +259

const selectVideo = (asset: ImagePickerAsset) => {
// compression step on native converts to mp4, so no need to check there
if (isWeb) {
const mimeType = getMimeType(asset)
if (!SUPPORTED_MIME_TYPES.includes(mimeType as SupportedMimeTypes)) {
throw new Error(_(msg`Unsupported video type: ${mimeType}`))
const selectVideo = React.useCallback(
(asset: ImagePickerAsset) => {
// compression step on native converts to mp4, so no need to check there
if (isWeb) {
const mimeType = getMimeType(asset)
if (!SUPPORTED_MIME_TYPES.includes(mimeType as SupportedMimeTypes)) {
throw new Error(_(msg`Unsupported video type: ${mimeType}`))
}
}
}

dispatch({
type: 'SetAsset',
asset,
})
onSelectVideo(asset)
}
dispatch({
type: 'SetAsset',
asset,
})
onSelectVideo(asset)
},
[_, onSelectVideo],
)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No change here, just wrapping in useCallback for the effect below

Copy link
Member

@mozzius mozzius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not tested but read through it and seems ok

@haileyok haileyok merged commit 7ee67e4 into main Sep 26, 2024
6 checks passed
@haileyok haileyok deleted the hailey/finish-intent-video branch September 26, 2024 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants