Skip to content

Commit 720a49d

Browse files
committed
#1310: Cleaning code
1 parent e9f982f commit 720a49d

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,10 @@ const ReimbursementRequestForm: React.FC<ReimbursementRequestFormProps> = ({
122122
} = useAllProjects();
123123

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

131130
const toast = useToast();
132131
const history = useHistory();

0 commit comments

Comments
 (0)