From 05f592a198fac02810b5b9ad6eb04778f2bb6738 Mon Sep 17 00:00:00 2001 From: Sami Mokaddem Date: Thu, 19 Jan 2023 10:27:54 +0100 Subject: [PATCH] fix: [ui:connectionTestResult] Only display error once --- webroot/js/main.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/webroot/js/main.js b/webroot/js/main.js index 420d1bf..2e2def0 100644 --- a/webroot/js/main.js +++ b/webroot/js/main.js @@ -55,11 +55,8 @@ function attachTestConnectionResultHtml(result, $container) { $testResultDiv.append(getKVHtml('Internal error', result, ['text-danger fw-bold'])) } else { if (result['error']) { - if (result['ping']) { - $testResultDiv.append('Status', 'OK', ['text-danger'], `${result['ping']} ms`); - } $testResultDiv.append( - getKVHtml('Status', `Error: ${result['error']}`, ['text-danger']), + getKVHtml('Status', `Error: ${result['error']}`, ['text-danger'], (result['ping'] ? `${result['ping']} ms` : '')), getKVHtml('Reason', result['reason'], ['text-danger']) ) } else {