fix: don't translate message on every ajaxify

v1.18.x
Barış Soner Uşaklı 4 years ago
parent 195e688bac
commit a29dd21de4

@ -2,6 +2,7 @@
(function () {
var logoutTimer = 0;
var logoutMessage;
function startLogoutTimer() {
if (app.config.adminReloginDuration <= 0) {
return;
@ -10,11 +11,10 @@
clearTimeout(logoutTimer);
}
// pre-translate language string gh#9046
var translated;
if (!translated) {
if (!logoutMessage) {
require(['translator'], function (translator) {
translator.translate('[[login:logged-out-due-to-inactivity]]', function (_translated) {
translated = _translated;
translator.translate('[[login:logged-out-due-to-inactivity]]', function (translated) {
logoutMessage = translated;
});
});
}
@ -22,7 +22,7 @@
logoutTimer = setTimeout(function () {
bootbox.alert({
closeButton: false,
message: translated,
message: logoutMessage,
callback: function () {
window.location.reload();
},

Loading…
Cancel
Save