0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00

Merge pull request #4551 from jaswilli/editor-401-modal

Do not display "auth failed" modal on clean posts.
This commit is contained in:
Hannah Wolfe 2014-12-01 11:04:59 +00:00
commit 1e4a3cb204

View file

@ -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();