Skip to content

Commit

Permalink
Handle assoc list error
Browse files Browse the repository at this point in the history
On this way, the ui does not block and it shows and error message
  • Loading branch information
selankon committed Mar 25, 2024
1 parent 0728fda commit 97a3930
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion plugins/lime-plugin-align/src/alignPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@ export const AssocRow = ({ station, iface }) => {
};

export const AssocList = ({ iface }) => {
const { data: assoclist, isLoading } = useAssocList(iface, {
const {
data: assoclist,
isLoading,
isError,
} = useAssocList(iface, {
refetchInterval: 2000,
});

Expand All @@ -92,6 +96,14 @@ export const AssocList = ({ iface }) => {
);
}

if (isError || !assoclist) {
return (
<div className="container container-center">
<Trans>Error retrieving associated list</Trans>
</div>
);
}

return (
<List>
{assoclist.length > 0 && (
Expand Down

0 comments on commit 97a3930

Please sign in to comment.