Skip to content

Commit b50b137

Browse files
authored
Merge pull request #264 from idpass/fix/mosip-276-unused-prop-crash
fix(mosip#276): crash due to undefined function
2 parents f44558c + ab7fcd0 commit b50b137

7 files changed

Lines changed: 21 additions & 44 deletions

File tree

components/SingleVcItem.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,17 @@ export const SingleVcItem: React.FC<VcItemProps> = (props) => {
114114
? ''
115115
: getLocalizedField(verifiableCredential.credentialSubject.fullName);
116116

117-
const selectableOrCheck = props.selectable ? null : null;
117+
const selectableOrCheck = props.selectable ? (
118+
<CheckBox
119+
checked={props.selected}
120+
checkedIcon={<Icon name="radio-button-checked" />}
121+
uncheckedIcon={<Icon name="radio-button-unchecked" />}
122+
onPress={() => props.onPress(service)}
123+
/>
124+
) : null;
118125

119126
return (
120-
<Column
121-
onShow={props.onShow(service)}
122-
style={Theme.Styles.closeCardBgContainer}>
127+
<Column style={Theme.Styles.closeCardBgContainer}>
123128
<ImageBackground
124129
source={!verifiableCredential ? null : Theme.CloseCard}
125130
resizeMode="stretch"

machines/scan.ts

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@ const model = createModel(
5959
SELECT_VC: (vc: VC) => ({ vc }),
6060
SCAN: (params: string) => ({ params }),
6161
ACCEPT_REQUEST: (shouldVerifySender: boolean) => ({ shouldVerifySender }),
62-
VERIFY_AND_ACCEPT_REQUEST: (shouldVerifySender: boolean) => ({
63-
shouldVerifySender,
64-
}),
62+
VERIFY_AND_ACCEPT_REQUEST: () => ({}),
6563
VC_ACCEPTED: () => ({}),
6664
VC_REJECTED: () => ({}),
6765
CANCEL: () => ({}),
@@ -252,22 +250,13 @@ export const scanMachine = model.createMachine(
252250
SELECT_VC: {
253251
actions: ['setSelectedVc'],
254252
},
255-
VERIFY_AND_ACCEPT_REQUEST: [
256-
{
257-
cond: 'shouldVerifySender',
258-
target: 'verifyingIdentity',
259-
},
260-
{
261-
target: 'verifyingIdentity',
262-
},
263-
],
264-
ACCEPT_REQUEST: [
265-
{
266-
cond: 'shouldVerifySender',
267-
actions: 'setShouldVerifyPresence',
268-
target: 'sendingVc',
269-
},
270-
],
253+
VERIFY_AND_ACCEPT_REQUEST: {
254+
target: 'verifyingIdentity',
255+
},
256+
ACCEPT_REQUEST: {
257+
actions: 'setShouldVerifyPresence',
258+
target: 'sendingVc',
259+
},
271260
CANCEL: '#scan.reviewing.cancelling',
272261
},
273262
},
@@ -480,7 +469,7 @@ export const scanMachine = model.createMachine(
480469
setShouldVerifyPresence: assign({
481470
selectedVc: (context) => ({
482471
...context.selectedVc,
483-
shouldVerifyPresence: true,
472+
shouldVerifyPresence: context.shouldVerifySender,
484473
}),
485474
}),
486475
},
@@ -675,8 +664,6 @@ export const scanMachine = model.createMachine(
675664
return false;
676665
}
677666
},
678-
679-
shouldVerifySender: (_context, event) => event.shouldVerifySender,
680667
},
681668

682669
delays: {

machines/scan.typegen.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ export interface Typegen0 {
113113
'eventsCausingGuards': {
114114
isQrOffline: 'SCAN';
115115
isQrOnline: 'SCAN';
116-
shouldVerifySender: 'ACCEPT_REQUEST' | 'VERIFY_AND_ACCEPT_REQUEST';
117116
};
118117
'eventsCausingDelays': {
119118
CANCEL_TIMEOUT: 'CANCEL';

package-lock.json

Lines changed: 0 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@
6767
"react-native-simple-markdown": "^1.1.0",
6868
"react-native-svg": "12.1.1",
6969
"react-native-swipe-gestures": "^1.0.5",
70-
"react-native-system-setting": "^1.7.6",
7170
"react-native-uuid": "^2.0.1",
7271
"react-native-vector-icons": "^8.1.0",
7372
"xstate": "^4.26.0"
@@ -101,4 +100,4 @@
101100
"react": "17.0.1",
102101
"react-native": "0.64.4"
103102
}
104-
}
103+
}

screens/Home/ViewVcModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const ViewVcModal: React.FC<ViewVcModalProps> = (props) => {
4141
<Modal
4242
isVisible={props.isVisible}
4343
onDismiss={props.onDismiss}
44-
headerTitle={controller.vc.tag || controller.vc.id}
44+
headerTitle={controller.vc.id}
4545
headerElevation={2}
4646
headerRight={
4747
<DropdownIcon

screens/Scan/SendVcScreenController.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,7 @@ export function useSendVcScreen() {
8585
ACCEPT_REQUEST: () =>
8686
scanService.send(ScanEvents.ACCEPT_REQUEST(shouldVerifySender)),
8787
VERIFY_AND_ACCEPT_REQUEST: () =>
88-
scanService.send(
89-
ScanEvents.VERIFY_AND_ACCEPT_REQUEST(shouldVerifySender)
90-
),
88+
scanService.send(ScanEvents.VERIFY_AND_ACCEPT_REQUEST()),
9189
DISMISS: () => scanService.send(ScanEvents.DISMISS()),
9290
UPDATE_REASON: (reason: string) =>
9391
scanService.send(ScanEvents.UPDATE_REASON(reason)),

0 commit comments

Comments
 (0)