From c6556c9d8fa8a6efa3cd4399a10cb2050a01618d Mon Sep 17 00:00:00 2001 From: sumn2u Date: Tue, 16 Jul 2024 10:56:41 -0500 Subject: [PATCH] show server connection error msg on connection lost --- client/src/Annotation/index.jsx | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/client/src/Annotation/index.jsx b/client/src/Annotation/index.jsx index fb340ce..59f4d6f 100644 --- a/client/src/Annotation/index.jsx +++ b/client/src/Annotation/index.jsx @@ -272,13 +272,23 @@ export default () => { setSettings(savedConfiguration) if (savedConfiguration.images.length > 0) { fetchImages(savedConfiguration.images, lastSavedImageIndex) + const showLab = settingsConfig.settings?.showLab || false + if (!isSettingsOpen && showLab) { + setShowLabel(showLab) + } + } else { + setSettings((prevSettings) => ({ + ...prevSettings, + images: [], + imagesBlob: [], + })) } } - const showLab = settingsConfig.settings?.showLab || false - if (!isSettingsOpen && showLab) { - setShowLabel(showLab) - } + } catch (error) { + if(!error) { + showSnackbar(t("error.server_connection"), "error") + } console.error(error) } }