mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 18:31:57 +03:00
3cd1eb5826
closes https://github.com/TryGhost/Team/issues/506 - launch wizard and brand settings both shared the same design and behaviour for customising brand settings but used duplicated code that had diverged - extracted the more up-to-date behaviour from the launch wizard into a component - updated brand settings and launch wizard to use the new component changes to brand settings modal behaviour: - preview is no longer interactive - switches to using iframe contents replacement instead of `postMessage`
26 lines
644 B
JavaScript
26 lines
644 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() {
|
|
this.settings.rollbackAttributes();
|
|
}
|
|
|
|
@task
|
|
*saveAndContinueTask() {
|
|
try {
|
|
yield this.settings.save();
|
|
this.args.nextStep();
|
|
} catch (error) {
|
|
if (error) {
|
|
this.notifications.showAPIError(error);
|
|
throw error;
|
|
}
|
|
}
|
|
}
|
|
}
|