From a67d19092719574a7ca033a8e1b417b50dcc3736 Mon Sep 17 00:00:00 2001 From: Giulio Cesare Solaroli Date: Thu, 3 Dec 2015 16:51:56 +0100 Subject: [PATCH] Fixed logout error handling --- frontend/delta/js/Clipperz/PM/Connection.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/frontend/delta/js/Clipperz/PM/Connection.js b/frontend/delta/js/Clipperz/PM/Connection.js index 78cd284..fe56aa3 100644 --- a/frontend/delta/js/Clipperz/PM/Connection.js +++ b/frontend/delta/js/Clipperz/PM/Connection.js @@ -431,10 +431,15 @@ Clipperz.PM.Connection.SRP['1.0'].prototype = MochiKit.Base.update(new Clipperz. //========================================================================= 'logout': function() { - return Clipperz.Async.callbacks("Connection.logout", [ - MochiKit.Base.method(this, 'setSharedSecret'), - MochiKit.Base.method(this.proxy(), 'logout', {}) - ], {trace:false}); + var deferredResult; + + deferredResult = new Clipperz.Async.Deferred("Connection.login", {trace:false}); + deferredResult.addMethod(this, 'setSharedSecret'); + deferredResult.addMethod(this.proxy(), 'logout', {}); + deferredResult.addErrback(function (aResult) { Clipperz.log("Ignored error while logging out"); return {}; }); + deferredResult.callback(); + + return deferredResult; }, //=========================================================================