Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(mosip#276): crash due to undefined function #264

Merged
merged 5 commits into from
Nov 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions components/SingleVcItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,17 @@ export const SingleVcItem: React.FC<VcItemProps> = (props) => {
? ''
: getLocalizedField(verifiableCredential.credentialSubject.fullName);

const selectableOrCheck = props.selectable ? null : null;
const selectableOrCheck = props.selectable ? (
<CheckBox
checked={props.selected}
checkedIcon={<Icon name="radio-button-checked" />}
uncheckedIcon={<Icon name="radio-button-unchecked" />}
onPress={() => props.onPress(service)}
/>
) : null;

return (
<Column
onShow={props.onShow(service)}
style={Theme.Styles.closeCardBgContainer}>
<Column style={Theme.Styles.closeCardBgContainer}>
<ImageBackground
source={!verifiableCredential ? null : Theme.CloseCard}
resizeMode="stretch"
Expand Down
31 changes: 9 additions & 22 deletions machines/scan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ const model = createModel(
SELECT_VC: (vc: VC) => ({ vc }),
SCAN: (params: string) => ({ params }),
ACCEPT_REQUEST: (shouldVerifySender: boolean) => ({ shouldVerifySender }),
VERIFY_AND_ACCEPT_REQUEST: (shouldVerifySender: boolean) => ({
shouldVerifySender,
}),
VERIFY_AND_ACCEPT_REQUEST: () => ({}),
VC_ACCEPTED: () => ({}),
VC_REJECTED: () => ({}),
CANCEL: () => ({}),
Expand Down Expand Up @@ -252,22 +250,13 @@ export const scanMachine = model.createMachine(
SELECT_VC: {
actions: ['setSelectedVc'],
},
VERIFY_AND_ACCEPT_REQUEST: [
{
cond: 'shouldVerifySender',
target: 'verifyingIdentity',
},
{
target: 'verifyingIdentity',
},
],
ACCEPT_REQUEST: [
{
cond: 'shouldVerifySender',
actions: 'setShouldVerifyPresence',
target: 'sendingVc',
},
],
VERIFY_AND_ACCEPT_REQUEST: {
target: 'verifyingIdentity',
},
ACCEPT_REQUEST: {
actions: 'setShouldVerifyPresence',
target: 'sendingVc',
},
CANCEL: '#scan.reviewing.cancelling',
},
},
Expand Down Expand Up @@ -480,7 +469,7 @@ export const scanMachine = model.createMachine(
setShouldVerifyPresence: assign({
selectedVc: (context) => ({
...context.selectedVc,
shouldVerifyPresence: true,
shouldVerifyPresence: context.shouldVerifySender,
}),
}),
},
Expand Down Expand Up @@ -675,8 +664,6 @@ export const scanMachine = model.createMachine(
return false;
}
},

shouldVerifySender: (_context, event) => event.shouldVerifySender,
},

delays: {
Expand Down
1 change: 0 additions & 1 deletion machines/scan.typegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ export interface Typegen0 {
'eventsCausingGuards': {
isQrOffline: 'SCAN';
isQrOnline: 'SCAN';
shouldVerifySender: 'ACCEPT_REQUEST' | 'VERIFY_AND_ACCEPT_REQUEST';
};
'eventsCausingDelays': {
CANCEL_TIMEOUT: 'CANCEL';
Expand Down
11 changes: 0 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
"react-native-simple-markdown": "^1.1.0",
"react-native-svg": "12.1.1",
"react-native-swipe-gestures": "^1.0.5",
"react-native-system-setting": "^1.7.6",
"react-native-uuid": "^2.0.1",
"react-native-vector-icons": "^8.1.0",
"xstate": "^4.26.0"
Expand Down Expand Up @@ -101,4 +100,4 @@
"react": "17.0.1",
"react-native": "0.64.4"
}
}
}
2 changes: 1 addition & 1 deletion screens/Home/ViewVcModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const ViewVcModal: React.FC<ViewVcModalProps> = (props) => {
<Modal
isVisible={props.isVisible}
onDismiss={props.onDismiss}
headerTitle={controller.vc.tag || controller.vc.id}
headerTitle={controller.vc.id}
headerElevation={2}
headerRight={
<DropdownIcon
Expand Down
4 changes: 1 addition & 3 deletions screens/Scan/SendVcScreenController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,7 @@ export function useSendVcScreen() {
ACCEPT_REQUEST: () =>
scanService.send(ScanEvents.ACCEPT_REQUEST(shouldVerifySender)),
VERIFY_AND_ACCEPT_REQUEST: () =>
scanService.send(
ScanEvents.VERIFY_AND_ACCEPT_REQUEST(shouldVerifySender)
),
scanService.send(ScanEvents.VERIFY_AND_ACCEPT_REQUEST()),
DISMISS: () => scanService.send(ScanEvents.DISMISS()),
UPDATE_REASON: (reason: string) =>
scanService.send(ScanEvents.UPDATE_REASON(reason)),
Expand Down