diff --git a/CHANGES b/CHANGES index 149f248..ddccd0c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,10 @@ +0.50.1 2024-08-30 12:27:22 +0200 Tobias Oetiker + + - show a popup before reloading the page + +0.50.0 2024-08-29 17:12:41 +0200 Tobias Oetiker + + - reload the browser window when an exception with status 7 is returned - warn if trm() is called with undefined arguments 0.49.6 2024-07-17 17:25:39 +0200 Tobias Oetiker diff --git a/lib/CallBackery.pm b/lib/CallBackery.pm index 652e7d3..e20c710 100644 --- a/lib/CallBackery.pm +++ b/lib/CallBackery.pm @@ -38,7 +38,7 @@ use CallBackery::Database; use CallBackery::User; use Scalar::Util qw(weaken); -our $VERSION = '0.49.6'; +our $VERSION = '0.50.1'; =head2 config diff --git a/lib/CallBackery/qooxdoo/callbackery/source/class/callbackery/data/Server.js b/lib/CallBackery/qooxdoo/callbackery/source/class/callbackery/data/Server.js index 3501135..a3b1176 100644 --- a/lib/CallBackery/qooxdoo/callbackery/source/class/callbackery/data/Server.js +++ b/lib/CallBackery/qooxdoo/callbackery/source/class/callbackery/data/Server.js @@ -49,16 +49,34 @@ qx.Class.define("callbackery.data.Server", { var localeMgr = qx.locale.Manager.getInstance(); var newArgs = Array.prototype.slice.call(arguments); newArgs[0] = function(ret, exc, id) { - if (exc && exc.code == 6) { - var login = callbackery.ui.Login.getInstance(); - login.addListenerOnce('login', function(e) { - var ret = e.getData(); - origThis.setSessionCookie(ret.sessionCookie); - origArguments.callee.base.apply(origThis, origArguments); - }); - - login.open(); - return; + if (exc) { + switch (exc.code) { + case 6: + let login = callbackery.ui.Login.getInstance(); + login.addListenerOnce('login', (e) => { + let ret = e.getData(); + origThis.setSessionCookie(ret.sessionCookie); + origArguments.callee.base.apply(origThis, origArguments); + }); + login.open(); + return; + case 7: + if (window.console){ + window.console.log("Session Expired. Reloading page"); + } + callbackery.ui.Busy.getInstance().vanish(); + let mb = callbackery.ui.MsgBox.getInstance() + mb.addListenerOnce('choice',(e) => { + if (e.getData() == 'ok'){ + window.location.reload(true); + } + }); + mb.info( + mb.tr('Session Expired'), + mb.xtr(exc.message) + ); + return; + } } try { handler(ret, exc, id);