Skip to content

Commit

Permalink
Fix(priorities): changed initial state for countryVNRs to null and co…
Browse files Browse the repository at this point in the history
…nditionally set to empty list or the proper data (#18)
  • Loading branch information
GedionT authored Oct 6, 2024
1 parent 1fcc9d7 commit 9ad654a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Priorities/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export const Priorities = (props: Props) => {
const [selectYear, setSelectYear] = useState<null | number>(null);
const [error, setError] = useState<any>(null);
const [data, setData] = useState<any>(null);
const [countryVNRs, setCountryVNRs] = useState<any>([]);
const [countryVNRs, setCountryVNRs] = useState<any>(null);
const [strategy, setStrategy] = useState<'equal' | 'proportional'>('equal');
const [status, setStatus] = useState<string | null>(null);
const [selectedDocument, setSelectedDocument] = useState();
Expand All @@ -109,6 +109,7 @@ export const Priorities = (props: Props) => {
setCountryVNRs(metadata);
setSelectedDocument(metadata[0]._id);
} else {
setCountryVNRs([]);
setError('No VNRs');
}
} catch (err) {
Expand Down

0 comments on commit 9ad654a

Please sign in to comment.