Ghost/ghost/admin/app/components/gh-launch-wizard/customise-design.js
Kevin Ansfield 1ad2c05d37 Bumped eslint-plugin-ghost and fixed linter errors
no issue

- new linting rules that needed fixing:
   - calling `super` in lifecycle hooks
   - no usage of String prototype extensions
2021-07-15 15:27:29 +01:00

31 lines
854 B
JavaScript

import Component from '@glimmer/component';
import {inject as service} from '@ember/service';
import {task} from 'ember-concurrency-decorators';
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;
}
}
}
}