open-vault/ui/app/controllers/vault.js
Jordan Reimer 52fe56ec87
Eslint prefer-const (#17864)
* adds prefer-const to eslint config and runs fixer

* reverts unintended change
2022-11-09 15:15:31 -08:00

27 lines
774 B
JavaScript

import { inject as service } from '@ember/service';
import Controller from '@ember/controller';
import { computed } from '@ember/object';
import config from '../config/environment';
export default Controller.extend({
queryParams: [
{
wrappedToken: 'wrapped_token',
redirectTo: 'redirect_to',
},
],
wrappedToken: '',
redirectTo: '',
env: config.environment,
auth: service(),
store: service(),
activeCluster: computed('auth.activeCluster', function () {
const id = this.auth.activeCluster;
return id ? this.store.peekRecord('cluster', id) : null;
}),
activeClusterName: computed('activeCluster', function () {
const activeCluster = this.activeCluster;
return activeCluster ? activeCluster.get('name') : null;
}),
});