Skip to content

Commit e9f982f

Browse files
committed
#1310: Added comments for validating logic and checked for isLoading
1 parent 05a7a08 commit e9f982f

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/frontend/src/pages/FinancePage/ReimbursementRequestForm/ReimbursementRequestForm.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,11 @@ const ReimbursementRequestForm: React.FC<ReimbursementRequestFormProps> = ({
121121
data: allProjects
122122
} = useAllProjects();
123123

124-
const { data } = useCurrentUserSecureSettings();
124+
// checking the data here instead of using isError since function doesn't ever return an error
125+
const { data, isLoading: checkSecureSettingsIsLoading } = useCurrentUserSecureSettings();
125126
const userSecureSettings = data ?? {};
127+
128+
// checks to make sure none of the secure settings fields are empty, indicating not properly set
126129
const hasSecureSettingsSet = Object.values(userSecureSettings).every((x) => x !== '') ? true : false;
127130

128131
const toast = useToast();
@@ -138,7 +141,8 @@ const ReimbursementRequestForm: React.FC<ReimbursementRequestFormProps> = ({
138141
allProjectsIsLoading ||
139142
!allVendors ||
140143
!allExpenseTypes ||
141-
!allProjects
144+
!allProjects ||
145+
checkSecureSettingsIsLoading
142146
)
143147
return <LoadingIndicator />;
144148

0 commit comments

Comments
 (0)