diff --git a/packages/web/src/appobj/ConnectionAppObject.svelte b/packages/web/src/appobj/ConnectionAppObject.svelte index 0cf2c44ef..5a817310e 100644 --- a/packages/web/src/appobj/ConnectionAppObject.svelte +++ b/packages/web/src/appobj/ConnectionAppObject.svelte @@ -6,15 +6,22 @@ export let commonProps; export let data; - function getStatusIcon(opened, data) { + let statusIcon = null; + let statusTitle = null; + + $: { const { _id, status } = data; - if (opened.includes(_id)) { - if (!status) return 'icon loading'; - if (status.name == 'pending') return 'icon loading'; - if (status.name == 'ok') return 'img ok'; - return 'img error'; + if ($openedConnections.includes(_id)) { + if (!status) statusIcon = 'icon loading'; + else if (status.name == 'pending') statusIcon = 'icon loading'; + else if (status.name == 'ok') statusIcon = 'img ok'; + else statusIcon = 'img error'; + if (status && status.name == 'error') { + statusTitle = status.message; + } } } + ($openedConnections = _.uniq([...$openedConnections, data._id]))} />