Skip to content

Commit

Permalink
Reload backend if not logged in (to get to the login window)
Browse files Browse the repository at this point in the history
  • Loading branch information
sabberworm committed Apr 30, 2018
1 parent 3ad1c86 commit ebad71c
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions web/js/widget/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,11 +363,7 @@ jQuery.widget("ui.dialog", jQuery.ui.dialog, {
return Widget.singletons[widgetType];
}
var widgetInformation = Widget.loadInfo(widgetType);
Widget.widgetJSON(widgetType, session, 'instanciateWidget', function(instanceInformation, error) {
if(error) {
Widget.notifyUser(Widget.logSeverity.ALERT, error.message);
return;
}
Widget.widgetJSON(widgetType, session, 'instanciateWidget', function(instanceInformation) {
var widget = new Widget.types[widgetType](instanceInformation);
widget._type = widgetType;

Expand Down Expand Up @@ -769,13 +765,8 @@ jQuery.widget("ui.dialog", jQuery.ui.dialog, {
},

needs_login: function(error, widgetType, widgetOrId, action, callback, options, attributes) {
Widget.create('login_window', function(login_widget) {
login_widget.show();
Widget.handle('rapila-logged_in', function(event) {
// Re-try the action
Widget.widgetJSON(widgetType, widgetOrId, action, callback, options, attributes);
}, true);
});
Widget.notifyUser(Widget.logSeverity.ALERT, error.message);
window.location.reload();
return false;
},

Expand Down

0 comments on commit ebad71c

Please sign in to comment.