Skip to content

Commit 0ea2469

Browse files
committed
Check cancellationDetails
1 parent d41364f commit 0ea2469

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

src/hooks/useCancellationType.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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) {

src/pages/settings/Subscription/RequestEarlyCancellationPage/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ function RequestEarlyCancellationPage() {
109109
const contentMap: Partial<Record<CancellationType, ReactNode>> = {
110110
[CONST.CANCELLATION_TYPE.MANUAL]: manualCancellationContent,
111111
[CONST.CANCELLATION_TYPE.AUTOMATIC]: automaticCancellationContent,
112+
[CONST.CANCELLATION_TYPE.NONE]: manualCancellationContent,
112113
};
113114

114115
const screenContent = cancellationType ? contentMap[cancellationType] : surveyContent;

0 commit comments

Comments
 (0)