Skip to content

Commit

Permalink
Show spinner when list of available checks is still loading (#1152)
Browse files Browse the repository at this point in the history
  • Loading branch information
rolfheij-sil authored Sep 23, 2024
2 parents 2302dfa + abf2afc commit 681f4a8
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,15 @@ export default function ConfigureChecks({
);
}, [activeRanges]);

const noAvailableChecks = useMemo(() => availableChecks.length === 0, [availableChecks]);
const singleEmptyCheck = useMemo(
() => availableChecks.length === 1 && availableChecks[0].checkId === '',
[availableChecks],
);

return (
<div className="configure-checks-dialog">
{availableChecks.length === 0 ? (
{noAvailableChecks || singleEmptyCheck ? (
<div className="configure-checks-loader">
<Spinner />
<Label>Loading checks</Label>
Expand Down

0 comments on commit 681f4a8

Please sign in to comment.