@@ -31,7 +31,7 @@ import { Approved } from '@/pages/CollectionFlow/components/pages/Approved';
3131import { Failed } from '@/pages/CollectionFlow/components/pages/Failed' ;
3232import { Rejected } from '@/pages/CollectionFlow/components/pages/Rejected' ;
3333import { Success } from '@/pages/CollectionFlow/components/pages/Success' ;
34- import { CollectionFlowManager , CollectionFlowStates } from '@ballerine/common' ;
34+ import { CollectionFlowManager , CollectionFlowStatuses } from '@ballerine/common' ;
3535import { AnyObject } from '@ballerine/ui' ;
3636
3737const elems = {
@@ -74,7 +74,7 @@ export const CollectionFlow = withSessionProtected(() => {
7474
7575 const pageErrors = usePageErrors ( context ?? ( { } as CollectionFlowContext ) , elements || [ ] ) ;
7676 const isRevision = useMemo (
77- ( ) => context ?. collectionFlow ?. state ?. collectionFlowState === CollectionFlowStates . revision ,
77+ ( ) => context ?. collectionFlow ?. state ?. status === CollectionFlowStatuses . revision ,
7878 [ context ] ,
7979 ) ;
8080
@@ -83,8 +83,8 @@ export const CollectionFlow = withSessionProtected(() => {
8383
8484 if ( isRevision ) {
8585 const revisionStateName = getRevisionStateName ( pageErrors ) ;
86- collectionFlowManager . state ( ) . uiState =
87- revisionStateName || collectionFlowManager . state ( ) . uiState ;
86+ collectionFlowManager . state ( ) . currentStep =
87+ revisionStateName || collectionFlowManager . state ( ) . currentStep ;
8888 }
8989
9090 return collectionFlowManager . context as CollectionFlowContext ;
@@ -106,10 +106,10 @@ export const CollectionFlow = withSessionProtected(() => {
106106 setLogoLoaded ( false ) ;
107107 } , [ customer ?. logoImageUri ] ) ;
108108
109- if ( initialContext ?. collectionFlow ?. state ?. collectionFlowState === CollectionFlowStates . approved )
109+ if ( initialContext ?. collectionFlow ?. state ?. status === CollectionFlowStatuses . approved )
110110 return < Approved /> ;
111111
112- if ( initialContext ?. collectionFlow ?. state ?. collectionFlowState === CollectionFlowStates . rejected )
112+ if ( initialContext ?. collectionFlow ?. state ?. status === CollectionFlowStatuses . rejected )
113113 return < Rejected /> ;
114114
115115 return definition && context ? (
@@ -132,16 +132,15 @@ export const CollectionFlow = withSessionProtected(() => {
132132 const collectionFlowManager = new CollectionFlowManager ( stateApi . getContext ( ) ) ;
133133
134134 const isAnyStepCompleted = Object . values (
135- collectionFlowManager . state ( ) . progress || { } ,
135+ collectionFlowManager . state ( ) . progressBreakdown || { } ,
136136 ) . some ( step => step . isCompleted ) ;
137137
138138 collectionFlowManager . state ( ) . setStepCompletionState ( prevState , true ) ;
139- collectionFlowManager . state ( ) . uiState = currentState ;
139+ collectionFlowManager . state ( ) . currentStep = currentState ;
140140
141141 if ( ! isAnyStepCompleted ) {
142142 console . log ( 'Collection flow touched, changing state to inprogress' ) ;
143- collectionFlowManager . state ( ) . collectionFlowState =
144- CollectionFlowStates . inprogress ;
143+ collectionFlowManager . state ( ) . status = CollectionFlowStatuses . inprogress ;
145144
146145 console . log ( 'Updating context to' , collectionFlowManager . context ) ;
147146 }
0 commit comments