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

Merge pull request #6317 from kevinansfield/quick-fix-unnecessary-leave-editor-modal

Quick-fix for unnecessary "discard changes" modals
This commit is contained in:
Hannah Wolfe 2016-01-12 09:39:59 +00:00
commit a658be931f

View file

@ -5,7 +5,7 @@ import SlugGenerator from 'ghost/models/slug-generator';
import boundOneWay from 'ghost/utils/bound-one-way';
import isNumber from 'ghost/utils/isNumber';
const {$, ArrayProxy, Controller, Handlebars, PromiseProxyMixin, RSVP, computed, guidFor, inject, isArray, observer, run} = Ember;
const {$, ArrayProxy, Controller, Handlebars, PromiseProxyMixin, RSVP, computed, guidFor, inject, isArray, isBlank, observer, run} = Ember;
export default Controller.extend(SettingsMenuMixin, {
debounceId: null,
@ -66,7 +66,9 @@ export default Controller.extend(SettingsMenuMixin, {
promise = RSVP.resolve(afterSave).then(() => {
return this.get('slugGenerator').generateSlug(title).then((slug) => {
this.set(destination, slug);
if (!isBlank(slug)) {
this.set(destination, slug);
}
}).catch(() => {
// Nothing to do (would be nice to log this somewhere though),
// but a rejected promise needs to be handled here so that a resolved