Skip to content

Commit

Permalink
fix deeplink and shortenedUrl, small fix with the patch file (#255)
Browse files Browse the repository at this point in the history
Signed-off-by: Jean-Christophe Drouin <jean-christophe.drouin@mcn.gouv.qc.ca>
  • Loading branch information
jcdrouin21 authored Feb 4, 2025
1 parent 1e36d15 commit 0a04fe1
Show file tree
Hide file tree
Showing 9 changed files with 141 additions and 120 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ index ce791235318e3b773a7f97580f9e205ad9995ded..1bc8109123f4e793dd994dccaa84e3cf
const navigation = useNavigation<StackNavigationProp<HomeStackParams>>()
const [store, dispatch] = useStore()
diff --git a/App/screens/Home.tsx b/App/screens/Home.tsx
index ad946ed3ee1af79bbdc90fa70e30eefd6782128c..cad23deeaecba2faebdffe1f1f297f70f408482c 100644
index ad946ed3ee1af79bbdc90fa70e30eefd6782128c..c6e493347c07bf806ba0615ae4d8be519b401129 100644
--- a/App/screens/Home.tsx
+++ b/App/screens/Home.tsx
@@ -40,6 +40,8 @@ const Home: React.FC<HomeProps> = () => {
Expand All @@ -33,7 +33,7 @@ index ad946ed3ee1af79bbdc90fa70e30eefd6782128c..cad23deeaecba2faebdffe1f1f297f70
const styles = StyleSheet.create({
flatlist: {
marginBottom: 35,
@@ -49,26 +51,48 @@ const Home: React.FC<HomeProps> = () => {
@@ -49,26 +51,47 @@ const Home: React.FC<HomeProps> = () => {
const DisplayListItemType = useCallback((item: any): React.ReactNode => {
let component: React.ReactNode
if (item.type === 'BasicMessageRecord') {
Expand All @@ -56,8 +56,7 @@ index ad946ed3ee1af79bbdc90fa70e30eefd6782128c..cad23deeaecba2faebdffe1f1f297f70
+ openSwipeableId={notificationItemId}
+ onOpenSwipeable={setNotificationItemId}
+ notificationType={notificationType}
+ notification={item}
+ />
+ notification={item} />
+ )
} else if (item.type === 'CustomNotification' && customNotification) {
component = (
Expand All @@ -72,17 +71,41 @@ index ad946ed3ee1af79bbdc90fa70e30eefd6782128c..cad23deeaecba2faebdffe1f1f297f70
} else {
- component = <NotificationListItem notificationType={NotificationType.ProofRequest} notification={item} />
+ component = (
+ <NotificationListItem
+ openSwipeableId={notificationItemId}
+ onOpenSwipeable={setNotificationItemId}
+ notificationType={NotificationType.ProofRequest}
+ notification={item}
+ />
+ )
+ <NotificationListItem
+ openSwipeableId={notificationItemId}
+ onOpenSwipeable={setNotificationItemId}
+ notificationType={NotificationType.ProofRequest}
+ notification={item}
+ />
+ )
}
return component
- }, [customNotification, NotificationListItem])
+ }, [customNotification, NotificationListItem, notificationItemId, setNotificationItemId])

useEffect(() => {
const shouldShowTour = enableToursConfig && store.tours.enableTours && !store.tours.seenHomeTour
diff --git a/App/utils/helpers.ts b/App/utils/helpers.ts
index 3ee51ab9691f55fe50f2ebc17cfe80953507545e..a124aba162a53e465366bf16ca2ffd87d7144d83 100644
--- a/App/utils/helpers.ts
+++ b/App/utils/helpers.ts
@@ -55,7 +55,7 @@ import {
getDescriptorMetadata,
} from './anonCredsProofRequestMapper'
import { parseCredDefFromId } from './cred-def'
-import { isOpenIdCredentialOffer, isOpenIdPresentationRequest } from './parsers'
+import { InvitationQrTypes, isOpenIdCredentialOffer, isOpenIdPresentationRequest } from './parsers'

export { parsedCredDefNameFromCredential } from './cred-def'

@@ -1086,6 +1086,10 @@ export const connectFromScanOrDeepLink = async (
return
}

+ if (uri.startsWith(InvitationQrTypes.DIDCOMM) && !(uri.includes('c_i=') || uri.includes('oob=') || uri.includes('oobUrl=') || uri.includes('d_m='))) {
+ uri = uri.replace(InvitationQrTypes.DIDCOMM, InvitationQrTypes.HTTPS)
+ }
+
const aUrl = processBetaUrlIfRequired(uri)
const receivedInvitation = await connectFromInvitation(aUrl, agent, implicitInvitations, reuseConnection)

2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"@formatjs/intl-relativetimeformat": "9.3.1",
"@hyperledger/anoncreds-react-native": "0.2.4",
"@hyperledger/aries-askar-react-native": "0.2.3",
"@hyperledger/aries-bifold-core": "1.0.0-alpha.438",
"@hyperledger/aries-bifold-core": "patch:@hyperledger/aries-bifold-core@npm%3A1.0.0-alpha.438#~/.yarn/patches/@hyperledger-aries-bifold-core-npm-1.0.0-alpha.438-31ea1fddec.patch",
"@hyperledger/aries-bifold-remote-logs": "1.0.0-alpha.438",
"@hyperledger/aries-bifold-verifier": "1.0.0-alpha.438",
"@hyperledger/aries-oca": "1.0.0-alpha.438",
Expand Down
2 changes: 1 addition & 1 deletion app/src/localization/en/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,7 @@ const translation = {
CardDescription: {
Proof: 'Proof request {{operation}}',
CardChanged: 'Card {{cardName}} {{operation}}',
ContactUpdated: '{{contactName}} has been {{operation}}.',
ContactUpdated: ' has been {{operation}}.',
WalletPinUpdated: 'New PIN set',
BiometricUpdated: 'Biometrics has been {{operation}}',
},
Expand Down
2 changes: 1 addition & 1 deletion app/src/localization/fr/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,7 @@ const translation = {
CardDescription: {
Proof: "Demande d'information {{operation}}",
CardChanged: 'Attestation {{cardName}} {{operation}}',
ContactUpdated: '{{contactName}} a été {{operation}}.',
ContactUpdated: ' a été {{operation}}.',
WalletPinUpdated: "Un nouveau NIP a été défini pour l'application",
BiometricUpdated: 'La biométrie a été {{operation}}',
},
Expand Down
20 changes: 12 additions & 8 deletions app/src/navigators/TabStack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,18 @@ const TabStack: React.FC = () => {
async (deepLink: string) => {
logger.info(`Handling deeplink: ${deepLink}`)

// If it's just the general link with no params, set link inactive and do nothing
if (deepLink.search(/oob=|c_i=|d_m=|url=/) < 0) {
dispatch({
type: DispatchAction.ACTIVE_DEEP_LINK,
payload: [undefined],
})
return
}
/*
deeplink + shortened URL get stock here:
// If it's just the general link with no params, set link inactive and do nothing
if (deepLink.search(/oob=|c_i=|d_m=|url=/) < 0) {
dispatch({
type: DispatchAction.ACTIVE_DEEP_LINK,
payload: [undefined],
})
return
}
*/

try {
await connectFromScanOrDeepLink(
Expand Down
10 changes: 6 additions & 4 deletions app/src/screens/activities/ContactHistoryDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,12 @@ const ContactHistoryDetails: React.FC<ContactHistoryDetailsProp> = ({ route, nav
<SafeAreaView style={styles.container} edges={['left', 'right', 'bottom']}>
<ScrollView contentContainerStyle={[styles.contentContainer]} showsVerticalScrollIndicator={false}>
<HeaderText
title={t('History.CardDescription.ContactUpdated', {
contactName: itemContent.correspondenceName ? startCaseUnicode(itemContent.correspondenceName) : '',
operation: operation,
})}
title={
(itemContent.correspondenceName ? startCaseUnicode(itemContent.correspondenceName) : '') +
t('History.CardDescription.ContactUpdated', {
operation: operation,
})
}
/>

<View style={{ marginTop: 20 }} />
Expand Down
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@
"react-native-vision-camera": "4.3.1",
"@credo-ts/react-hooks": "patch:@credo-ts/react-hooks@npm%3A0.6.0#./.yarn/patches/@credo-ts-react-hooks-npm-0.6.0-3c59ce13d2.patch",
"@hyperledger/indy-vdr-shared@npm:0.2.2": "patch:@hyperledger/indy-vdr-shared@npm%3A0.2.2#~/.yarn/patches/@hyperledger-indy-vdr-shared-npm-0.2.2-b989282fc6.patch",
"@hyperledger/indy-vdr-react-native": "patch:@hyperledger/indy-vdr-react-native@npm%3A0.2.2#~/.yarn/patches/@hyperledger-indy-vdr-react-native-npm-0.2.2-627d424b96.patch",
"@hyperledger/aries-bifold-core@npm:^1.0.0-alpha.436+c65cbd86": "patch:@hyperledger/aries-bifold-core@npm%3A1.0.0-alpha.436#~/.yarn/patches/@hyperledger-aries-bifold-core-npm-1.0.0-alpha.436-cdfc82d5ec.patch",
"@hyperledger/aries-bifold-core@npm:^1.0.0-alpha.438+f9009bd8": "patch:@hyperledger/aries-bifold-core@npm%3A1.0.0-alpha.438#~/.yarn/patches/@hyperledger-aries-bifold-core-npm-1.0.0-alpha.438-31ea1fddec.patch"
"@hyperledger/indy-vdr-react-native": "patch:@hyperledger/indy-vdr-react-native@npm%3A0.2.2#~/.yarn/patches/@hyperledger-indy-vdr-react-native-npm-0.2.2-627d424b96.patch"
}
}
88 changes: 85 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3318,9 +3318,91 @@ __metadata:
languageName: node
linkType: hard

"@hyperledger/aries-bifold-core@npm:^1.0.0-alpha.438+f9009bd8":
version: 1.0.0-alpha.439
resolution: "@hyperledger/aries-bifold-core@npm:1.0.0-alpha.439"
peerDependencies:
"@credo-ts/anoncreds": 0.5.11
"@credo-ts/askar": 0.5.11
"@credo-ts/core": 0.5.11
"@credo-ts/indy-sdk-to-askar-migration": 0.5.11
"@credo-ts/indy-vdr": 0.5.11
"@credo-ts/openid4vc": 0.5.11
"@credo-ts/push-notifications": ^0.7.0
"@credo-ts/question-answer": 0.5.11
"@credo-ts/react-hooks": ^0.6.0
"@credo-ts/react-native": 0.5.11
"@formatjs/intl-datetimeformat": 4.2.4
"@formatjs/intl-displaynames": 5.2.4
"@formatjs/intl-getcanonicallocales": 1.7.3
"@formatjs/intl-listformat": 6.3.4
"@formatjs/intl-locale": 2.4.38
"@formatjs/intl-numberformat": 7.2.4
"@formatjs/intl-pluralrules": 4.1.4
"@formatjs/intl-relativetimeformat": 9.3.1
"@hyperledger/anoncreds-react-native": 0.2.4
"@hyperledger/aries-askar-react-native": 0.2.3
"@hyperledger/aries-bifold-verifier": ^1.0.0
"@hyperledger/aries-oca": ^1.0.0
"@hyperledger/indy-vdr-react-native": 0.2.2
"@hyperledger/indy-vdr-shared": 0.2.2
"@react-native-async-storage/async-storage": 1.15.11
"@react-native-community/masked-view": 0.1.11
"@react-native-community/netinfo": ^9.3.0
"@react-navigation/bottom-tabs": 6.0.9
"@react-navigation/core": 6.1.0
"@react-navigation/devtools": ^6.0.8
"@react-navigation/native": 6.0.6
"@react-navigation/stack": 6.0.11
axios: ^1.4.0
base-64: ^1.0.0
i18next: ^21.4.0
lodash.flatten: ^4.4.0
lodash.startcase: ^4.4.0
moment: ^2.29.4
query-string: ^7.0.1
react: ^18.2.0
react-i18next: 11.13.0
react-native: "*"
react-native-animated-pagination-dots: ^0.1.72
react-native-argon2: ^2.0.1
react-native-bouncy-checkbox: ^3.0.5
react-native-collapsible: ^1.6.1
react-native-config: ^1.4.2
react-native-confirmation-code-field: ^7.3.0
react-native-device-info: ^8.4.9
react-native-encrypted-storage: ^4.0.2
react-native-fs: ^2.16.6
react-native-gesture-handler: ^1.10.3
react-native-get-random-values: ^1.7.0
react-native-gifted-chat: 2.4.0
react-native-keychain: ^8.1.1
react-native-localize: ^2.2.4
react-native-logs: ^5.1.0
react-native-orientation-locker: "*"
react-native-permissions: ^4.0.1
react-native-qrcode-svg: 6.2.0
react-native-reanimated: 3.4.2
react-native-safe-area-context: ^3.2.0
react-native-screens: ^3.24.0
react-native-splash-screen: ^3.3.0
react-native-svg: ^12.1.1
react-native-tcp-socket: ^6.0.6
react-native-toast-message: ^2.1.6
react-native-uuid: ^2.0.1
react-native-vector-icons: ^10.0.0
react-native-vision-camera: "*"
tsyringe: ^4.7.0
uuid: ^9.0.0
bin:
bifold: bin/bifold
checksum: 205334aacca708bf8f1f65277576d10871202c9c46eb7e6c8e9b778c7ef963c2cc21520f56fa0df3c55376cb31ae530be6e290be3abd7c396a03fe4c5a52c5ca
languageName: node
linkType: hard

"@hyperledger/aries-bifold-core@patch:@hyperledger/aries-bifold-core@npm%3A1.0.0-alpha.438#~/.yarn/patches/@hyperledger-aries-bifold-core-npm-1.0.0-alpha.438-31ea1fddec.patch":
version: 1.0.0-alpha.438
resolution: "@hyperledger/aries-bifold-core@patch:@hyperledger/aries-bifold-core@npm%3A1.0.0-alpha.438#~/.yarn/patches/@hyperledger-aries-bifold-core-npm-1.0.0-alpha.438-31ea1fddec.patch::version=1.0.0-alpha.438&hash=52c62b"
resolution: "@hyperledger/aries-bifold-core@patch:@hyperledger/aries-bifold-core@npm%3A1.0.0-alpha.438#~/.yarn/patches/@hyperledger-aries-bifold-core-npm-1.0.0-alpha.438-31ea1fddec.patch::version=1.0.0-alpha.438&hash=1caca3"
peerDependencies:
"@credo-ts/anoncreds": 0.5.11
"@credo-ts/askar": 0.5.11
Expand Down Expand Up @@ -3396,7 +3478,7 @@ __metadata:
uuid: ^9.0.0
bin:
bifold: bin/bifold
checksum: 73d0bee52953831bca64adf764a08240f704f7a7e0b8bb85baba0392484aac380d629c4dea23e666ba871d8bfd92297eb10cdfe8625c78d1d44a946dde56396a
checksum: f47a315c84f8622315bb0f217eb9d27d84d11a4a609a066d0d8f8f941a78c59da6ecb66a5453e185873ac0a1550c2de44a38d3783efe3f24972bae5b4293ea45
languageName: node
linkType: hard

Expand Down Expand Up @@ -20136,7 +20218,7 @@ __metadata:
"@formatjs/intl-relativetimeformat": "npm:9.3.1"
"@hyperledger/anoncreds-react-native": "npm:0.2.4"
"@hyperledger/aries-askar-react-native": "npm:0.2.3"
"@hyperledger/aries-bifold-core": "npm:1.0.0-alpha.438"
"@hyperledger/aries-bifold-core": "patch:@hyperledger/aries-bifold-core@npm%3A1.0.0-alpha.438#~/.yarn/patches/@hyperledger-aries-bifold-core-npm-1.0.0-alpha.438-31ea1fddec.patch"
"@hyperledger/aries-bifold-remote-logs": "npm:1.0.0-alpha.438"
"@hyperledger/aries-bifold-verifier": "npm:1.0.0-alpha.438"
"@hyperledger/aries-oca": "npm:1.0.0-alpha.438"
Expand Down

0 comments on commit 0a04fe1

Please sign in to comment.