Ghost/ghost/admin/app/routes/settings/membership.js
Kevin Ansfield 686dadbeda Fixed errors when closing portal settings modal
no issue

- added actions for handling close/confirm/cancel of portal settings rather than re-using the route-level leave modal because the portal settings modal does not need any knowledge of the route
- added controller reset that is called when the route is exited to ensure no modals are shown when navigating back to the membership screen
- fixed "cannot set on destroyed" error when portal settings are opened and closed quickly
- removed usage of old `{{action}}` helper - this has been replaced with `{{on}}` and `{{fn}}`
2021-05-17 12:41:21 +01:00

29 lines
632 B
JavaScript

import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
import {inject as service} from '@ember/service';
export default class MembershipSettingsRoute extends AuthenticatedRoute {
@service settings;
model() {
this.settings.reload();
}
actions = {
willTransition(transition) {
return this.controller.leaveRoute(transition);
}
}
buildRouteInfoMetadata() {
return {
titleToken: 'Settings - Membership'
};
}
resetController(controller, isExiting) {
if (isExiting) {
controller.reset();
}
}
}