Skip to content

Commit 2e0ca3c

Browse files
committed
show server connection error msg on connection lost
1 parent 28c62ac commit 2e0ca3c

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

client/src/Annotation/index.jsx

+14-4
Original file line numberDiff line numberDiff line change
@@ -272,13 +272,23 @@ export default () => {
272272
setSettings(savedConfiguration)
273273
if (savedConfiguration.images.length > 0) {
274274
fetchImages(savedConfiguration.images, lastSavedImageIndex)
275+
const showLab = settingsConfig.settings?.showLab || false
276+
if (!isSettingsOpen && showLab) {
277+
setShowLabel(showLab)
278+
}
279+
} else {
280+
setSettings((prevSettings) => ({
281+
...prevSettings,
282+
images: [],
283+
imagesBlob: [],
284+
}))
275285
}
276286
}
277-
const showLab = settingsConfig.settings?.showLab || false
278-
if (!isSettingsOpen && showLab) {
279-
setShowLabel(showLab)
280-
}
287+
281288
} catch (error) {
289+
if(!error) {
290+
showSnackbar(t("error.server_connection"), "error")
291+
}
282292
console.error(error)
283293
}
284294
}

0 commit comments

Comments
 (0)