Ghost/ghost/admin/app/components/modal-leave-settings.js
Daniel Lockyer b284e2e4da 🐛 Fixed sticky "unsaved settings" modal
fixes https://github.com/TryGhost/Team/issues/777

- the unsaved settings modal would come back if you left a settings
  sub-page with unsaved changes and then came back to the page
- if you then clicked on "Leave", Admin would crash with a Sentry error
  of `Cannot read property 'finally' of undefined`
- we had a similar bug in
  39c850f4fe
  and the fix was to remove the `.finally` because it assumed the
  confirm action returned a promise
- this commit performs a similar fix and seems to resolve the problem
2021-06-11 09:15:27 +01:00

15 lines
308 B
JavaScript

import ModalComponent from 'ghost-admin/components/modal-base';
import RSVP from 'rsvp';
export default ModalComponent.extend({
actions: {
confirm() {
this.confirm();
this.send('closeModal');
}
},
// Allowed actions
confirm: () => RSVP.resolve()
});