use method that's actually available on android (#8448)
(cherry picked from commit b523140153)
This commit is contained in:
committed by
Eric Bailey
parent
1e620b19cc
commit
6fbd6605d1
@@ -10,6 +10,7 @@ import {type NavigationProp} from '#/lib/routes/types'
|
|||||||
import {shareText, shareUrl} from '#/lib/sharing'
|
import {shareText, shareUrl} from '#/lib/sharing'
|
||||||
import {toShareUrl} from '#/lib/strings/url-helpers'
|
import {toShareUrl} from '#/lib/strings/url-helpers'
|
||||||
import {logger} from '#/logger'
|
import {logger} from '#/logger'
|
||||||
|
import {isIOS} from '#/platform/detection'
|
||||||
import {useProfileShadow} from '#/state/cache/profile-shadow'
|
import {useProfileShadow} from '#/state/cache/profile-shadow'
|
||||||
import {useSession} from '#/state/session'
|
import {useSession} from '#/state/session'
|
||||||
import * as Toast from '#/view/com/util/Toast'
|
import * as Toast from '#/view/com/util/Toast'
|
||||||
@@ -61,12 +62,16 @@ let ShareMenuItems = ({
|
|||||||
onShareProp()
|
onShareProp()
|
||||||
}
|
}
|
||||||
|
|
||||||
const onCopyLink = () => {
|
const onCopyLink = async () => {
|
||||||
logger.metric('share:press:copyLink', {}, {statsig: true})
|
logger.metric('share:press:copyLink', {}, {statsig: true})
|
||||||
const url = toShareUrl(href)
|
const url = toShareUrl(href)
|
||||||
ExpoClipboard.setUrlAsync(url).then(() =>
|
if (isIOS) {
|
||||||
Toast.show(_(msg`Copied to clipboard`), 'clipboard-check'),
|
// iOS only
|
||||||
)
|
await ExpoClipboard.setUrlAsync(url)
|
||||||
|
} else {
|
||||||
|
await ExpoClipboard.setStringAsync(url)
|
||||||
|
}
|
||||||
|
Toast.show(_(msg`Copied to clipboard`), 'clipboard-check')
|
||||||
onShareProp()
|
onShareProp()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user