From ce9be7e69483aff6cc97570a98fb7c61bef77a03 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Thu, 10 Nov 2016 15:59:08 +0300 Subject: [PATCH] closes #5132 --- public/src/app.js | 10 ++-------- public/src/sockets.js | 11 +---------- src/middleware/header.js | 2 +- 3 files changed, 4 insertions(+), 19 deletions(-) diff --git a/public/src/app.js b/public/src/app.js index d8aa8cc979..1720d4acbf 100644 --- a/public/src/app.js +++ b/public/src/app.js @@ -288,20 +288,14 @@ app.cacheBuster = null; if (showWelcomeMessage) { showWelcomeMessage = false; - if (document.readyState !== 'complete') { - $(document).ready(showAlert.bind(null, 'login')); - } else { showAlert('login'); - } + }); } if (showBannedMessage) { showBannedMessage = false; - if (document.readyState !== 'complete') { - $(document).ready(showAlert.bind(null, 'banned')); - } else { showAlert('banned'); - } + }); } }; diff --git a/public/src/sockets.js b/public/src/sockets.js index cd88c3e5f7..c255287c58 100644 --- a/public/src/sockets.js +++ b/public/src/sockets.js @@ -122,16 +122,7 @@ app.isConnected = false; } function onEventBanned() { - app.alert({ - title: '[[global:alert.banned]]', - message: '[[global:alert.banned.message]]', - type: 'danger', - timeout: 1000 - }); - - setTimeout(function () { - window.location.href = config.relative_path + '/'; - }, 1000); + window.location.href = config.relative_path + '/'; } }()); \ No newline at end of file diff --git a/src/middleware/header.js b/src/middleware/header.js index 7e6f6cccbe..53a20e33eb 100644 --- a/src/middleware/header.js +++ b/src/middleware/header.js @@ -107,7 +107,7 @@ module.exports = function (middleware) { if (results.banned) { req.logout(); - return res.redirect('/?banned=' + (results.banReason || '')); + return res.redirect('/?banned=' + (results.banReason || 'no-reason')); } results.user.isAdmin = results.isAdmin;