File tree Expand file tree Collapse file tree
pages/settings/Subscription/RequestEarlyCancellationPage Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import ONYXKEYS from '@src/ONYXKEYS';
55import useOnyx from './useOnyx' ;
66
77function useCancellationType ( ) : CancellationType | undefined {
8- const [ cancellationDetails ] = useOnyx ( ONYXKEYS . NVP_PRIVATE_CANCELLATION_DETAILS ) ;
8+ const [ cancellationDetails ] = useOnyx ( ONYXKEYS . NVP_PRIVATE_CANCELLATION_DETAILS , { canBeMissing : true } ) ;
99
1010 const [ cancellationType , setCancellationType ] = useState < CancellationType | undefined > ( ) ;
1111
@@ -20,6 +20,12 @@ function useCancellationType(): CancellationType | undefined {
2020 return CONST . CANCELLATION_TYPE . MANUAL ;
2121 }
2222
23+ // Check for cancellation with type "none"
24+ const noneCancellation = cancellationDetails ?. find ( ( detail ) => detail . cancellationType === CONST . CANCELLATION_TYPE . NONE ) ;
25+ if ( noneCancellation ) {
26+ return CONST . CANCELLATION_TYPE . NONE ;
27+ }
28+
2329 // There are no new items in the cancellation details NVP
2430 // eslint-disable-next-line react-compiler/react-compiler
2531 if ( previousCancellationDetails . current ?. length === cancellationDetails ?. length ) {
Original file line number Diff line number Diff line change @@ -106,6 +106,7 @@ function RequestEarlyCancellationPage() {
106106 const contentMap : Partial < Record < CancellationType , ReactNode > > = {
107107 [ CONST . CANCELLATION_TYPE . MANUAL ] : manualCancellationContent ,
108108 [ CONST . CANCELLATION_TYPE . AUTOMATIC ] : automaticCancellationContent ,
109+ [ CONST . CANCELLATION_TYPE . NONE ] : manualCancellationContent ,
109110 } ;
110111
111112 const screenContent = cancellationType ? contentMap [ cancellationType ] : surveyContent ;
You can’t perform that action at this time.
0 commit comments