diff --git a/ui/core/app/controllers/scopes/scope/authenticate.js b/ui/core/app/controllers/scopes/scope/authenticate.js index 139f77c05..5c36ec58e 100644 --- a/ui/core/app/controllers/scopes/scope/authenticate.js +++ b/ui/core/app/controllers/scopes/scope/authenticate.js @@ -1,19 +1,17 @@ import Controller from '@ember/controller'; -import { sort } from '@ember/object/computed'; export default class ScopesScopeAuthenticateController extends Controller { // =attributes /** + * Moves the global scope to index 0. * @type {Array} */ - @sort('model.scopes', (a, b) => { - if (a.isGlobal) { - return -1; - } else if (b.isGlobal) { - return 1; - } - return 0; - }) - sortedScopes; + get sortedScopes() { + return [ + ...this.model.scopes.filter((scope) => scope.id === 'global'), + ...this.model.scopes.filter((scope) => scope.id !== 'global'), + ] + } + }