Skip to content

Commit

Permalink
Merge pull request #603 from commons-stack/v_0_12_0
Browse files Browse the repository at this point in the history
AllPeriods return empty array instead of undefined
  • Loading branch information
kristoferlund committed Sep 26, 2022
2 parents 2d26815 + ce97d40 commit 8ee2cd5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/frontend/src/model/periods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ export type PeriodAndQuantifierPageParams = {
* and `settings` are not returned but need to be separately loaded using
* @DetailedSinglePeriodQuery
*/
export const AllPeriods = atom<PeriodDetailsDto[] | undefined>({
export const AllPeriods = atom<PeriodDetailsDto[]>({
key: 'AllPeriods',
default: undefined,
default: [],
effects: [
({ setSelf, getPromise }): void => {
setSelf(
Expand All @@ -83,6 +83,7 @@ export const AllPeriods = atom<PeriodDetailsDto[] | undefined>({
return periods;
}
}
return [];
})
);
},
Expand Down

0 comments on commit 8ee2cd5

Please sign in to comment.