WebUIs: fix some check conditions in js code

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino 2024-09-14 22:07:04 +02:00
parent 44ebf2f48d
commit c2aed5ee92
No known key found for this signature in database
GPG key ID: 935D2952DEC4EECF

View file

@ -313,14 +313,14 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
KTUtil.onDOMContentLoaded(function () { KTUtil.onDOMContentLoaded(function () {
var dismissErrorBtn = $('#id_dismiss_error_msg'); var dismissErrorBtn = $('#id_dismiss_error_msg');
if (dismissErrorBtn){ if (dismissErrorBtn.length){
dismissErrorBtn.on("click", function(){ dismissErrorBtn.on("click", function(){
$('#errorMsg').addClass("d-none"); $('#errorMsg').addClass("d-none");
}); });
} }
var logoutBtn = $('#id_logout_link'); var logoutBtn = $('#id_logout_link');
if (logoutBtn){ if (logoutBtn.length){
logoutBtn.on("click", function(){ logoutBtn.on("click", function(){
doLogout(); doLogout();
}); });