-
Notifications
You must be signed in to change notification settings - Fork 88
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(INJI-329): fix received card expand view and redirect the user to history screen after VC transfer #799
Changes from all commits
aa3271c
d29905e
1ac8bb4
9400c46
b3b5ed5
3c1fb50
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { MainBottomTabParamList } from './main'; | ||
|
||
export const BOTTOM_TAB_ROUTES = { | ||
home: 'home' as keyof MainBottomTabParamList, | ||
scan: 'scan' as keyof MainBottomTabParamList, | ||
history: 'history' as keyof MainBottomTabParamList, | ||
}; | ||
|
||
export const SCAN_ROUTES = { | ||
ScanScreen: 'ScanScreen' as keyof ScanStackParamList, | ||
SendVcScreen: 'SendVcScreen' as keyof ScanStackParamList, | ||
}; | ||
|
||
export const REQUEST_ROUTES = { | ||
Request: 'Request' as keyof RequestStackParamList, | ||
RequestScreen: 'RequestScreen' as keyof RequestStackParamList, | ||
ReceiveVcScreen: 'ReceiveVcScreen' as keyof RequestStackParamList, | ||
}; | ||
|
||
export type ScanStackParamList = { | ||
ScanScreen: undefined; | ||
SendVcScreen: undefined; | ||
}; | ||
|
||
export type RequestStackParamList = { | ||
Request: undefined; | ||
RequestScreen: undefined; | ||
ReceiveVcScreen: undefined; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,10 +11,7 @@ import { StoreEvents, StoreResponseEvent } from '../../machines/store'; | |
import { VcEvents } from '../../machines/vc'; | ||
import { vcItemMachine } from '../../machines/vcItem'; | ||
import { AppServices } from '../../shared/GlobalContext'; | ||
import { | ||
MY_VCS_STORE_KEY, | ||
ONBOARDING_STATUS_STORE_KEY, | ||
} from '../../shared/constants'; | ||
import { MY_VCS_STORE_KEY } from '../../shared/constants'; | ||
import { AddVcModalMachine } from './MyVcs/AddVcModalMachine'; | ||
import { GetVcModalMachine } from './MyVcs/GetVcModalMachine'; | ||
import Storage from '../../shared/storage'; | ||
|
@@ -36,7 +33,6 @@ const model = createModel( | |
GET_VC: () => ({}), | ||
STORAGE_AVAILABLE: () => ({}), | ||
STORAGE_UNAVAILABLE: () => ({}), | ||
ONBOARDING_DONE: () => ({}), | ||
IS_TAMPERED: () => ({}), | ||
}, | ||
} | ||
|
@@ -57,31 +53,8 @@ export const MyVcsTabMachine = model.createMachine( | |
events: {} as EventFrom<typeof model>, | ||
}, | ||
id: 'MyVcsTab', | ||
initial: 'checkingOnboardingStatus', | ||
initial: 'idle', | ||
states: { | ||
checkingOnboardingStatus: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is the onboarding flow removed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the old code we were using Onboarding status variable to decide whether we need to show the intro sliders in the MyVCs screen or not and when the app is installed and download the first VC we are setting that variable to true considering that onboarding is completed but there is a issue with this approach - |
||
entry: ['getOnboardingStatus'], | ||
on: { | ||
STORE_RESPONSE: [ | ||
{ cond: 'isOnboardingDone', target: 'idle' }, | ||
{ target: 'onboarding' }, | ||
], | ||
}, | ||
}, | ||
onboarding: { | ||
on: { | ||
ADD_VC: [ | ||
{ | ||
target: 'addVc', | ||
actions: ['completeOnboarding'], | ||
}, | ||
], | ||
ONBOARDING_DONE: { | ||
target: 'idle', | ||
actions: ['completeOnboarding'], | ||
}, | ||
}, | ||
}, | ||
addVc: { | ||
initial: 'checkStorage', | ||
states: { | ||
|
@@ -202,16 +175,6 @@ export const MyVcsTabMachine = model.createMachine( | |
model.events.VIEW_VC(event.vcItemActor) | ||
), | ||
|
||
getOnboardingStatus: send( | ||
() => StoreEvents.GET(ONBOARDING_STATUS_STORE_KEY), | ||
{ to: (context) => context.serviceRefs.store } | ||
), | ||
|
||
completeOnboarding: send( | ||
() => StoreEvents.SET(ONBOARDING_STATUS_STORE_KEY, true), | ||
{ to: (context) => context.serviceRefs.store } | ||
), | ||
|
||
storeVcItem: send( | ||
(_context, event) => { | ||
return StoreEvents.PREPEND( | ||
|
@@ -231,10 +194,6 @@ export const MyVcsTabMachine = model.createMachine( | |
}, | ||
|
||
guards: { | ||
isOnboardingDone: (_context, event: StoreResponseEvent) => { | ||
return event.response === true; | ||
}, | ||
|
||
isMinimumStorageLimitReached: (_context, event) => Boolean(event.data), | ||
}, | ||
} | ||
|
@@ -257,10 +216,6 @@ export function selectGetVcModal(state: State) { | |
return state.children.GetVcModal as ActorRefFrom<typeof GetVcModalMachine>; | ||
} | ||
|
||
export function selectIsOnboarding(state: State) { | ||
return state.matches('onboarding'); | ||
} | ||
|
||
export function selectIsRequestSuccessful(state: State) { | ||
return state.matches('addingVc.addVcSuccessful'); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, extracted the bottom tab, scan and request screen names into separate file to maintain the consistency