You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
consul/ui/packages/consul-ui/app/routes/settings.js

24 lines
517 B

import Route from 'consul-ui/routing/route';
import { inject as service } from '@ember/service';
import { action } from '@ember/object';
export default class SettingsRoute extends Route {
@service('client/http') client;
@service('settings') repo;
@action
change(slug, item) {
switch (slug) {
case 'client':
item.blocking = !item.blocking;
if (!item.blocking) {
this.client.abort();
}
break;
}
this.repo.persist({
[slug]: item,
});
}
}