From 97a393047182f27cc9eb412895d7a54204fdaae9 Mon Sep 17 00:00:00 2001 From: selankon Date: Mon, 25 Mar 2024 13:12:02 +0100 Subject: [PATCH] Handle assoc list error On this way, the ui does not block and it shows and error message --- plugins/lime-plugin-align/src/alignPage.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/plugins/lime-plugin-align/src/alignPage.js b/plugins/lime-plugin-align/src/alignPage.js index 8d34b51d..fd1f3b17 100644 --- a/plugins/lime-plugin-align/src/alignPage.js +++ b/plugins/lime-plugin-align/src/alignPage.js @@ -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, }); @@ -92,6 +96,14 @@ export const AssocList = ({ iface }) => { ); } + if (isError || !assoclist) { + return ( +
+ Error retrieving associated list +
+ ); + } + return ( {assoclist.length > 0 && (