Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

Commit

Permalink
Prepend audius url to share url (#2142)
Browse files Browse the repository at this point in the history
  • Loading branch information
sliptype authored Oct 13, 2022
1 parent 068917e commit e85955c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/mobile/src/utils/share.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Share } from 'react-native'
import Config from 'react-native-config'

// Docs for react native share: https://facebook.github.io/react-native/docs/share

Expand All @@ -8,9 +9,11 @@ type ShareProps = {
}

const share = async ({ message, url }: ShareProps) => {
const fullUrl = `${Config.AUDIUS_URL}${url}`

try {
// on iOS we can have both message and URL, on android, we need to concat
const context = { message: message ? `${message} ${url}` : url }
const context = { message: message ? `${message} ${fullUrl}` : fullUrl }
await Share.share(context)
} catch (error) {
console.error(error)
Expand Down

0 comments on commit e85955c

Please sign in to comment.