Skip to content

Commit

Permalink
Do not display "auth failed" modal on clean posts.
Browse files Browse the repository at this point in the history
Refs #4543
- Check EditorController.isDirty before displaying the
  authorization failed modal dialog.  This prevents the modal
  appearing immediately upon entering the editor in cases where
  auth has failed prior to opening the editor.
  • Loading branch information
jaswilli committed Nov 30, 2014
1 parent f3de619 commit df4e034
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions core/client/routes/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,16 @@ var ApplicationRoute = Ember.Route.extend(SimpleAuth.ApplicationRouteMixin, Shor

actions: {
authorizationFailed: function () {
var currentRoute = this.get('controller').get('currentRouteName');
var currentRoute = this.get('controller').get('currentRouteName'),
editorController;

if (currentRoute.split('.')[0] === 'editor') {
this.send('openModal', 'auth-failed-unsaved', this.controllerFor(currentRoute));
editorController = this.controllerFor(currentRoute);

return;
if (editorController.get('isDirty')) {
this.send('openModal', 'auth-failed-unsaved', editorController);
return;
}
}

this._super();
Expand Down

0 comments on commit df4e034

Please sign in to comment.