chore: 🤖 prevent unnecessary auth-method loading
which prevents unnecessary loading indicator jank
This commit is contained in:
2 files changed
+11
-12
No files matched your search
@@ -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,6 +1,5 @@
|
||||
import factory from '../generated/factories/scope';
|
||||
import { trait } from 'ember-cli-mirage';
|
||||
import { random } from 'faker';
|
||||
|
||||
export default factory.extend({
|
||||
|
||||
|
||||
Reference in new issue
Block a user