From 2f8a5b96076464aeb6b96d38369ef5d2cf25df95 Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Tue, 15 Sep 2020 11:20:29 -0400 Subject: [PATCH] refactor: Wait for page transition before a notification --- .../routes/scopes/scope/auth-methods/auth-method/accounts.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/core/app/routes/scopes/scope/auth-methods/auth-method/accounts.js b/ui/core/app/routes/scopes/scope/auth-methods/auth-method/accounts.js index 2de991ee2..d5fbc41ef 100644 --- a/ui/core/app/routes/scopes/scope/auth-methods/auth-method/accounts.js +++ b/ui/core/app/routes/scopes/scope/auth-methods/auth-method/accounts.js @@ -38,11 +38,11 @@ export default class ScopesScopeAuthMethodsAuthMethodAccountsRoute extends Route async save(account) { try { await account.save(); + await this.transitionTo('scopes.scope.auth-methods.auth-method.accounts.account', account); this.refresh(); this.notify.success( this.intl.t('notify.save-success') ); - this.transitionTo('scopes.scope.auth-methods.auth-method.accounts.account', account); } catch (error) { // TODO: replace with translated strings this.notify.error(error.message, { closeAfter: null }); @@ -57,9 +57,9 @@ export default class ScopesScopeAuthMethodsAuthMethodAccountsRoute extends Route async delete(account) { try { await account.destroyRecord(); + await this.transitionTo('scopes.scope.auth-methods.auth-method.accounts'); this.refresh(); this.notify.success(this.intl.t('notify.delete-success')); - this.transitionTo('scopes.scope.auth-methods.auth-method.accounts'); } catch (error) { //TODO: replace with translated strings this.notify.error(error.message, { closeAfter: null });