0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-13 22:41:32 -05:00

Do not display "auth failed" modal on clean posts.

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.
This commit is contained in:
Jason Williams 2014-11-30 18:13:05 +00:00
parent f3de619ea7
commit df4e0349ca

View file

@ -20,12 +20,16 @@ var ApplicationRoute = Ember.Route.extend(SimpleAuth.ApplicationRouteMixin, Shor
actions: { actions: {
authorizationFailed: function () { authorizationFailed: function () {
var currentRoute = this.get('controller').get('currentRouteName'); var currentRoute = this.get('controller').get('currentRouteName'),
editorController;
if (currentRoute.split('.')[0] === 'editor') { 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(); this._super();