diff --git a/static/scripts/app/views/notifications.js b/static/scripts/app/views/notifications.js index 96eec5cbb4..5637092f2c 100644 --- a/static/scripts/app/views/notifications.js +++ b/static/scripts/app/views/notifications.js @@ -45,8 +45,21 @@ define([ document.title = _this.orig_doc_title; } }, - error: function() { // e.g. 401 UNAUTHORIZED + error: function(xhr) { // e.g. 401 UNAUTHORIZED clearInterval(reqInterval); // stop sending requests + + var $el; + if (xhr.responseText) { + if (xhr.status == 401) { + $el = $('

' + gettext("You have logged out.") + '' + gettext("Log in") + '

'); + } + } else { + $el = $('

' + gettext("Please check the network.") + '

'); + } + $('#wrapper').prepend($el); + $('.top-bar-click', $el).click(function() { + location.reload(true); + }); } }); };