2021-01-21 12:20:06 +03:00
|
|
|
import Component from '@glimmer/component';
|
|
|
|
import {inject as service} from '@ember/service';
|
2021-01-28 02:16:54 +03:00
|
|
|
import {task} from 'ember-concurrency-decorators';
|
2021-01-21 12:20:06 +03:00
|
|
|
|
|
|
|
export default class GhLaunchWizardCustomiseDesignComponent extends Component {
|
2021-03-02 20:10:01 +03:00
|
|
|
@service notifications;
|
2021-01-21 12:20:06 +03:00
|
|
|
@service settings;
|
|
|
|
|
2021-02-18 20:06:56 +03:00
|
|
|
willDestroy() {
|
|
|
|
this.settings.rollbackAttributes();
|
2021-03-09 21:25:06 +03:00
|
|
|
this.settings.errors.remove('accentColor');
|
2021-01-21 12:20:06 +03:00
|
|
|
}
|
|
|
|
|
2021-02-18 20:06:56 +03:00
|
|
|
@task
|
|
|
|
*saveAndContinueTask() {
|
|
|
|
try {
|
2021-03-09 21:25:06 +03:00
|
|
|
if (this.settings.errors && this.settings.errors.length !== 0) {
|
|
|
|
return;
|
|
|
|
}
|
2021-02-18 20:06:56 +03:00
|
|
|
yield this.settings.save();
|
|
|
|
this.args.nextStep();
|
|
|
|
} catch (error) {
|
|
|
|
if (error) {
|
|
|
|
this.notifications.showAPIError(error);
|
|
|
|
throw error;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-01-21 12:20:06 +03:00
|
|
|
}
|