Ghost/ghost/admin/app/components/gh-launch-wizard/customise-design.js
Kevin Ansfield 8cc4c6c4a1 Dropped ember-concurrency-decorators dependency
no issue

- since `ember-concurrency@2.0` it's possible to use the standard imports as decorators removing the need for the extra `ember-concurrency-decorators` dependency and imports
2022-02-09 10:49:38 +00:00

31 lines
843 B
JavaScript

import Component from '@glimmer/component';
import {inject as service} from '@ember/service';
import {task} from 'ember-concurrency';
export default class GhLaunchWizardCustomiseDesignComponent extends Component {
@service notifications;
@service settings;
willDestroy() {
super.willDestroy?.(...arguments);
this.settings.rollbackAttributes();
this.settings.errors.remove('accentColor');
}
@task
*saveAndContinueTask() {
try {
if (this.settings.errors && this.settings.errors.length !== 0) {
return;
}
yield this.settings.save();
this.args.nextStep();
} catch (error) {
if (error) {
this.notifications.showAPIError(error);
throw error;
}
}
}
}