Skip to content

Commit

Permalink
fix: shared public key urls
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Louvigny committed Nov 27, 2018
1 parent 442b9fa commit 21e732b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Expand Up @@ -110,7 +110,7 @@ export default class Detail extends PureComponent {
icon='share'
title='Share this contact'
onPress={() => shareLinkOther({
contactId: extractPublicKeyFromId(contact.id),
id: extractPublicKeyFromId(contact.id),
displayName: contact.displayName,
})}
/>
Expand Down
10 changes: 5 additions & 5 deletions client/react-native/common/helpers/contacts.js
Expand Up @@ -29,10 +29,10 @@ export const extractPublicKeyFromId = contactId => {
}
}

export const makeShareableUrl = ({ contactId, displayName }) => `https://berty.tech/add-contact#public-key=${encodeURIComponent(contactId)}&display-name=${encodeURIComponent(displayName)}`
export const makeShareableUrl = ({ id, displayName }) => `https://berty.tech/add-contact#public-key=${encodeURIComponent(id)}&display-name=${encodeURIComponent(displayName)}`

export const shareLinkSelf = ({ contactId, displayName }) => {
const url = makeShareableUrl({ contactId, displayName })
export const shareLinkSelf = ({ id, displayName }) => {
const url = makeShareableUrl({ id, displayName })

Share.share({
title: 'Add me on Berty',
Expand All @@ -41,8 +41,8 @@ export const shareLinkSelf = ({ contactId, displayName }) => {
}).catch(() => null)
}

export const shareLinkOther = ({ contactId, displayName }) => {
const url = makeShareableUrl({ contactId, displayName })
export const shareLinkOther = ({ id, displayName }) => {
const url = makeShareableUrl({ id, displayName })

Share.share({
title: `Add ${displayName} on Berty`,
Expand Down

0 comments on commit 21e732b

Please sign in to comment.