fix: [ui:connectionTestResult] Only display error once

develop-unstable
Sami Mokaddem 2023-01-19 10:27:54 +01:00
parent 1c4853f8a5
commit 05f592a198
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 1 additions and 4 deletions

View File

@ -55,11 +55,8 @@ function attachTestConnectionResultHtml(result, $container) {
$testResultDiv.append(getKVHtml('Internal error', result, ['text-danger fw-bold'])) $testResultDiv.append(getKVHtml('Internal error', result, ['text-danger fw-bold']))
} else { } else {
if (result['error']) { if (result['error']) {
if (result['ping']) {
$testResultDiv.append('Status', 'OK', ['text-danger'], `${result['ping']} ms`);
}
$testResultDiv.append( $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']) getKVHtml('Reason', result['reason'], ['text-danger'])
) )
} else { } else {