refactor: Wait for page transition before a notification

This commit is contained in:
Susmitha Girumala committed 2020-09-15 11:20:29 -04:00
1 parent f657970a35
commit 2f8a5b9607
1 file changed
+2 -2
@@ -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 });