File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed
views/AccountMyFormsDref/ActiveDrefTable Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -85,8 +85,9 @@ export const FONT_FAMILY_HEADER = 'Montserrat';
8585export type DrefStatus = components < 'read' > [ 'schemas' ] [ 'DrefDrefStatusEnumKey' ] ;
8686
8787export const DREF_STATUS_DRAFT = 1 satisfies DrefStatus ;
88- export const DREF_STATUS_FINALIZED = 2 satisfies DrefStatus ;
89- export const DREF_STATUS_APPROVED = 3 satisfies DrefStatus ;
88+ export const DREF_STATUS_FINALIZING = 2 satisfies DrefStatus ;
89+ export const DREF_STATUS_FINALIZED = 3 satisfies DrefStatus ;
90+ export const DREF_STATUS_APPROVED = 4 satisfies DrefStatus ;
9091
9192export type TypeOfDrefEnum = components < 'read' > [ 'schemas' ] [ 'DrefDrefDrefTypeEnumKey' ] ;
9293export const DREF_TYPE_IMMINENT = 0 satisfies TypeOfDrefEnum ;
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ import useUserMe from '#hooks/domain/useUserMe';
3232import useFilterState from '#hooks/useFilterState' ;
3333import {
3434 DREF_STATUS_APPROVED ,
35+ DREF_STATUS_FINALIZING ,
3536 DREF_TYPE_LOAN ,
3637 type TypeOfDrefEnum ,
3738} from '#utils/constants' ;
@@ -87,6 +88,21 @@ function ActiveDrefTable(props: Props) {
8788 disaster_type : filter . disaster_type ,
8889 appeal_code : filter . appeal_code ,
8990 } ,
91+ shouldPoll : ( res ) => {
92+ if ( res . errored ) {
93+ return - 1 ;
94+ }
95+
96+ const hasFinalizingStatus = res . value . results . some (
97+ ( item ) => item . status === DREF_STATUS_FINALIZING ,
98+ ) ;
99+
100+ if ( ! hasFinalizingStatus ) {
101+ return - 1 ;
102+ }
103+
104+ return 3000 ;
105+ } ,
90106 } ) ;
91107
92108 const userMe = useUserMe ( ) ;
You can’t perform that action at this time.
0 commit comments