Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

web: fix logout. closes #25

  • Loading branch information...
commit e9cb2ddcabb5faafd9ec142f4d13333be2a561aa 1 parent 0ded9c9
@billiob billiob authored
Showing with 10 additions and 3 deletions.
  1. +10 −3 amsn2/ui/front_ends/web/static/js/amsn2.js
View
13 amsn2/ui/front_ends/web/static/js/amsn2.js
@@ -1,4 +1,4 @@
-
+var g_logging_out = false;
var g_loop = null;
// Utils {{{
@@ -393,7 +393,7 @@ function ChatWidget(_uid)
});
this.remove = function() {
- Event.StopObserving(t, 'keydown');
+ Event.stopObserving(t, 'keydown');
elem.remove();
win = null;
}
@@ -496,8 +496,12 @@ function setTitleCW(uid, title)
var g_mainWindow = null;
function logoutCb() {
+ if (g_logging_out)
+ return true;
if (confirm('Are you sure you want to logout?')) {
new Ajax.Request('/logout');
+ g_logging_out = true;
+ loggedOut();
return true;
}
return false;
@@ -577,7 +581,7 @@ function loggedOut() {
if (g_mainWindow) {
g_mainWindow.destroy();
- Event.StopObserving(window, 'resize');
+ Event.stopObserving(window, 'resize');
g_mainWindow = null;
}
@@ -591,6 +595,8 @@ function loggedOut() {
}
g_chatWindows = {};
+ g_logging_out = false;
+
showLogin();
}
@@ -638,6 +644,7 @@ Ajax.Responders.register({
function aMSNStart()
{
+ g_logging_out = false;
g_loop = new PeriodicalExecuter(function(pe) {
hideInfoIfNeeded();
new Ajax.Request('/out', {
Please sign in to comment.
Something went wrong with that request. Please try again.