Fixed integration edit page not showing after creating new integration

refs 054a5f15f5

- `beforeClose` behaviour has changed slightly with the upgraded ember-promise-modals
- added a guard for the modal existing when transitioning back to the integrations index screen, this makes sure we're not transitioning back to the index screen after the modal has already initiated a transition to the integration edit screen
This commit is contained in:
Kevin Ansfield 2022-03-11 19:10:44 +00:00
parent 054a5f15f5
commit 4db4233b87

View File

@ -5,6 +5,7 @@ import {inject as service} from '@ember/service';
export default class NewIntegrationRoute extends AdminRoute {
@service limit;
@service modals;
@service router;
modal = null;
@ -38,8 +39,8 @@ export default class NewIntegrationRoute extends AdminRoute {
@action
beforeModalClose() {
if (!this.isLeaving) {
this.transitionTo('settings.integrations');
if (this.modal && !this.isLeaving) {
this.router.transitionTo('settings.integrations');
}
}
}