Update from Git Manager GUI
This commit is contained in:
@@ -536,6 +536,13 @@
|
||||
wbfPost('wbf_update_profile', data, function (d) {
|
||||
showMsg($msg, d.message, true);
|
||||
$btn.prop('disabled', false);
|
||||
// Bio und Signatur sofort aktualisieren (ohne Reload)
|
||||
if (typeof data.bio !== 'undefined') {
|
||||
$('.wbf-profile-sidebar__bio-text').text(data.bio);
|
||||
}
|
||||
if (typeof data.signature !== 'undefined') {
|
||||
$('.wbf-profile-sidebar__sig').text(data.signature);
|
||||
}
|
||||
}, function (d) {
|
||||
showMsg($msg, d.message || 'Fehler', false);
|
||||
$btn.prop('disabled', false);
|
||||
@@ -1394,12 +1401,16 @@
|
||||
'</div>'
|
||||
].join('')).appendTo('body');
|
||||
|
||||
var wbfLogoutFired = false; // Guard gegen doppelten Logout-Call
|
||||
|
||||
function wbfDoLogout() {
|
||||
if (wbfLogoutFired) return; // doppelten Aufruf verhindern
|
||||
wbfLogoutFired = true;
|
||||
clearTimeout(wbfIdleTimer);
|
||||
clearTimeout(wbfWarnTimer);
|
||||
clearInterval(wbfCountTimer);
|
||||
$wbfToast.hide();
|
||||
wbfPost('wbf_logout', {}, function () {
|
||||
wbfPost('wbf_logout', { nonce: WBF.nonce }, function () {
|
||||
location.reload();
|
||||
});
|
||||
}
|
||||
@@ -1409,23 +1420,23 @@
|
||||
var secs = 30;
|
||||
$('#wbfIdleCountdown').text(secs);
|
||||
$wbfToast.fadeIn(200);
|
||||
// Countdown-Interval läuft bis 0 und ruft dann wbfDoLogout() auf —
|
||||
// kein zusätzlicher setTimeout(wbfDoLogout) nötig (war die Ursache des Doppel-Logouts)
|
||||
wbfCountTimer = setInterval(function () {
|
||||
secs--;
|
||||
$('#wbfIdleCountdown').text(secs);
|
||||
$('#wbfIdleCountdown').text(Math.max(0, secs));
|
||||
if (secs <= 0) {
|
||||
clearInterval(wbfCountTimer);
|
||||
wbfDoLogout();
|
||||
}
|
||||
}, 1000);
|
||||
// Auto-logout after warning period
|
||||
wbfIdleTimer = setTimeout(wbfDoLogout, wbfWarnMs);
|
||||
}
|
||||
|
||||
function wbfResetIdleTimer() {
|
||||
if (wbfWarning) return; // Nutzer hat aktiv Warnung bestätigt — nicht resetten
|
||||
clearTimeout(wbfIdleTimer);
|
||||
clearTimeout(wbfWarnTimer);
|
||||
// Warn 30 sec before timeout
|
||||
// Warnung 30 Sek. vor Ablauf zeigen
|
||||
wbfWarnTimer = setTimeout(wbfShowWarning, wbfIdleMs - wbfWarnMs);
|
||||
}
|
||||
|
||||
@@ -1435,6 +1446,7 @@
|
||||
clearInterval(wbfCountTimer);
|
||||
$wbfToast.fadeOut(200);
|
||||
wbfWarning = false;
|
||||
wbfLogoutFired = false; // Guard zurücksetzen
|
||||
wbfResetIdleTimer();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user