-
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 2 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 |
---|---|---|
|
@@ -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'); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,7 +58,7 @@ export function useRequestLayout() { | |
); | ||
useEffect(() => { | ||
if (isDone) { | ||
navigation.navigate('History'); | ||
navigation.navigate('history'); | ||
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. for users, Immediately navigating to history screen might be unexpected as he would want to see the VC that he has received before moving to different screen 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. Confirmed with @Kratitva regarding this, After closing the success popup we will be in the incoming card screen and only if the user clicks on View received card the user will be redirected to Received cards screen and if the user click on back button they will be redirected to QR code screen. I will make changes in the code |
||
} else if (isReviewing) { | ||
navigation.navigate('ReceiveVcScreen'); | ||
} else if (isWaitingForConnection) { | ||
|
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