fix: no global bootbox (#9879)

* fix: require bootbox (easy ones)

* fix: require bootbox (ugly ones)

* fix(eslint): a lengthy line
This commit is contained in:
gasoved
2021-10-08 22:25:36 +03:00
committed by GitHub
parent 94c4f87b2f
commit 227456fb17
35 changed files with 110 additions and 77 deletions

View File

@@ -217,13 +217,15 @@ app.cacheBuster = null;
app.handleInvalidSession = function () {
socket.disconnect();
app.logout(false);
bootbox.alert({
title: '[[error:invalid-session]]',
message: '[[error:invalid-session-text]]',
closeButton: false,
callback: function () {
window.location.reload();
},
require(['bootbox'], function (bootbox) {
bootbox.alert({
title: '[[error:invalid-session]]',
message: '[[error:invalid-session-text]]',
closeButton: false,
callback: function () {
window.location.reload();
},
});
});
};
@@ -233,13 +235,15 @@ app.cacheBuster = null;
}
socket.disconnect();
bootbox.alert({
title: '[[error:session-mismatch]]',
message: '[[error:session-mismatch-text]]',
closeButton: false,
callback: function () {
window.location.reload();
},
require(['bootbox'], function (bootbox) {
bootbox.alert({
title: '[[error:session-mismatch]]',
message: '[[error:session-mismatch-text]]',
closeButton: false,
callback: function () {
window.location.reload();
},
});
});
};
@@ -434,10 +438,12 @@ app.cacheBuster = null;
if (!isDnD) {
return createChat();
}
bootbox.confirm('[[modules:chat.confirm-chat-with-dnd-user]]', function (ok) {
if (ok) {
createChat();
}
require(['bootbox'], function (bootbox) {
bootbox.confirm('[[modules:chat.confirm-chat-with-dnd-user]]', function (ok) {
if (ok) {
createChat();
}
});
});
});
};