chore: 🤖 prevent unnecessary auth-method loading

which prevents unnecessary loading indicator jank
This commit is contained in:
Randall Morey committed 2020-10-01 17:42:55 -04:00
1 parent 7a4c6cf5fb
commit 362d31ec40
2 files changed
+11 -12

No files matched your search

+11 -11
View File
@@ -9,6 +9,17 @@ export default class ScopesScopeAuthenticateRoute extends Route {
// =methods
beforeModel() {
if (this.session.isAuthenticated) {
const scope = this.modelFor('scopes.scope');
if (scope.isGlobal) {
this.transitionTo('scopes.scope.orgs');
} else {
this.transitionTo('scopes.scope.projects');
}
}
}
/**
* Returns all auth methods for the current scope, along with the current
* scope and all scopes (for org navigation).
@@ -28,15 +39,4 @@ export default class ScopesScopeAuthenticateRoute extends Route {
// }])
});
}
redirect() {
if (this.session.isAuthenticated) {
const scope = this.modelFor('scopes.scope');
if (scope.isGlobal) {
this.transitionTo('scopes.scope.orgs');
} else {
this.transitionTo('scopes.scope.projects');
}
}
}
}
-1
View File
@@ -1,6 +1,5 @@
import factory from '../generated/factories/scope';
import { trait } from 'ember-cli-mirage';
import { random } from 'faker';
export default factory.extend({