mirror of
https://github.com/TryGhost/Ghost-Admin.git
synced 2023-12-14 02:33:04 +01:00
🐛 Fixed unexpected "unsaved changes" modals when accessing screens
no issue We weren't correctly clearing state for the "display modal" booleans when leaving screens. This meant that it was possible to end up in a state where where every time you access a screen you get the unsaved changes modal
This commit is contained in:
parent
b87fe7812e
commit
693d6b48b2
|
@ -668,6 +668,7 @@ export default Controller.extend({
|
|||
this.set('hasDirtyAttributes', false);
|
||||
this.set('shouldFocusEditor', false);
|
||||
this.set('leaveEditorTransition', null);
|
||||
this.set('showLeaveEditorModal', false);
|
||||
this.set('infoMessage', null);
|
||||
this.set('wordCount', null);
|
||||
|
||||
|
|
|
@ -16,6 +16,12 @@ export default AuthenticatedRoute.extend(CurrentUserSettings, {
|
|||
return this.settings.reload();
|
||||
},
|
||||
|
||||
deactivate() {
|
||||
this._super(...arguments);
|
||||
this.controller.set('leaveSettingsTransition', null);
|
||||
this.controller.set('showLeaveSettingsModal', false);
|
||||
},
|
||||
|
||||
actions: {
|
||||
save() {
|
||||
this.controller.send('save');
|
||||
|
|
|
@ -21,12 +21,16 @@ export default AuthenticatedRoute.extend(CurrentUserSettings, {
|
|||
},
|
||||
|
||||
setupController(controller) {
|
||||
// reset the leave setting transition
|
||||
controller.set('leaveSettingsTransition', null);
|
||||
controller.set('themes', this.store.peekAll('theme'));
|
||||
this.controller.send('reset');
|
||||
},
|
||||
|
||||
deactivate() {
|
||||
this._super(...arguments);
|
||||
this.controller.set('leaveSettingsTransition', null);
|
||||
this.controller.set('showLeaveSettingsModal', false);
|
||||
},
|
||||
|
||||
actions: {
|
||||
save() {
|
||||
// since shortcuts are run on the route, we have to signal to the components
|
||||
|
|
|
@ -23,6 +23,7 @@ export default AuthenticatedRoute.extend(CurrentUserSettings, {
|
|||
|
||||
setupController(controller, models) {
|
||||
// reset the leave setting transition
|
||||
controller.set('showLeaveSettingsModal', false);
|
||||
controller.set('leaveSettingsTransition', null);
|
||||
controller.set('availableTimezones', models.availableTimezones);
|
||||
},
|
||||
|
|
|
@ -28,6 +28,12 @@ export default AuthenticatedRoute.extend(CurrentUserSettings, {
|
|||
.integrationModelHook('id', params.integration_id, this, transition);
|
||||
},
|
||||
|
||||
deactivate() {
|
||||
this._super(...arguments);
|
||||
this.controller.set('leaveScreenTransition', null);
|
||||
this.controller.set('showUnsavedChangesModal', false);
|
||||
},
|
||||
|
||||
actions: {
|
||||
save() {
|
||||
this.controller.send('save');
|
||||
|
|
Loading…
Reference in a new issue