Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add code 7 to force browser reload #234

Merged
merged 2 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
0.50.1 2024-08-30 12:27:22 +0200 Tobias Oetiker <[email protected]>

- show a popup before reloading the page

0.50.0 2024-08-29 17:12:41 +0200 Tobias Oetiker <[email protected]>

- 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 <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion lib/CallBackery.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading