2021-08-13 14:41:34 +03:00
|
|
|
import ModalComponent from 'ghost-admin/components/modal-base';
|
|
|
|
import {alias} from '@ember/object/computed';
|
|
|
|
import {inject as service} from '@ember/service';
|
|
|
|
import {task} from 'ember-concurrency';
|
|
|
|
|
|
|
|
export default ModalComponent.extend({
|
|
|
|
membersStats: service(),
|
|
|
|
|
|
|
|
shouldCancelSubscriptions: false,
|
|
|
|
|
|
|
|
// Allowed actions
|
|
|
|
confirm: () => {},
|
|
|
|
|
|
|
|
member: alias('model'),
|
|
|
|
|
|
|
|
actions: {
|
|
|
|
confirm() {
|
2021-08-13 19:20:46 +03:00
|
|
|
this.unsubscribeMember.perform();
|
2021-08-13 14:41:34 +03:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2021-08-13 19:20:46 +03:00
|
|
|
unsubscribeMemberTask: task(function* () {
|
2021-08-13 14:41:34 +03:00
|
|
|
try {
|
2021-08-13 19:20:46 +03:00
|
|
|
yield this.confirm();
|
2021-08-13 14:41:34 +03:00
|
|
|
this.membersStats.invalidate();
|
|
|
|
} finally {
|
|
|
|
this.send('closeModal');
|
|
|
|
}
|
|
|
|
}).drop()
|
|
|
|
});
|