mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-13 22:53:32 +03:00
49b83add43
no issue - base modal component was throwing an error because the passed in `confirm` action for the leave settings modal wasn't async and didn't have a `.finally()` method
48 lines
1.3 KiB
JavaScript
48 lines
1.3 KiB
JavaScript
/* eslint-disable ghost/ember/alias-model-in-controller */
|
|
import Controller from '@ember/controller';
|
|
import {inject as service} from '@ember/service';
|
|
|
|
export default Controller.extend({
|
|
|
|
settings: service(),
|
|
session: service(),
|
|
|
|
queryParams: ['showPortalSettings', 'showBrandingModal'],
|
|
|
|
showPortalSettings: false,
|
|
showBrandingModal: false,
|
|
showLeaveSettingsModal: false,
|
|
|
|
tagName: '',
|
|
|
|
actions: {
|
|
openStripeSettings() {
|
|
this.set('membersStripeOpen', true);
|
|
},
|
|
|
|
closePortalSettings() {
|
|
const changedAttributes = this.settings.changedAttributes();
|
|
if (changedAttributes && Object.keys(changedAttributes).length > 0) {
|
|
this.set('showLeaveSettingsModal', true);
|
|
} else {
|
|
this.set('showPortalSettings', false);
|
|
}
|
|
},
|
|
|
|
closeLeaveSettingsModal() {
|
|
this.set('showLeaveSettingsModal', false);
|
|
},
|
|
|
|
async leavePortalSettings() {
|
|
this.settings.rollbackAttributes();
|
|
this.set('showPortalSettings', false);
|
|
this.set('showLeaveSettingsModal', false);
|
|
},
|
|
|
|
closeBrandingModal() {
|
|
this.set('showBrandingModal', false);
|
|
}
|
|
}
|
|
|
|
});
|