mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 18:31:57 +03:00
ad98a9a072
refs https://github.com/TryGhost/Ghost/issues/7865 - updates all settings screens to use EC tasks and `gh-task-button` to get save-state save buttons - removes now-unused `settings-save` mixin - moves the order of button color CSS so that grey buttons can change to green/red after completing - removes the heading from `apps-loading` template so that there's no odd flash when loading slack/amp screens directly
32 lines
693 B
JavaScript
32 lines
693 B
JavaScript
import Controller from 'ember-controller';
|
|
import injectService from 'ember-service/inject';
|
|
import {task} from 'ember-concurrency';
|
|
|
|
export default Controller.extend({
|
|
notifications: injectService(),
|
|
|
|
// will be set by route
|
|
settings: null,
|
|
|
|
save: task(function* () {
|
|
let amp = this.get('model');
|
|
let settings = this.get('settings');
|
|
|
|
settings.set('amp', amp);
|
|
|
|
try {
|
|
return yield settings.save();
|
|
|
|
} catch (error) {
|
|
this.get('notifications').showAPIError(error);
|
|
throw error;
|
|
}
|
|
}).drop(),
|
|
|
|
actions: {
|
|
update(value) {
|
|
this.set('model', value);
|
|
}
|
|
}
|
|
});
|