mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-03 03:55:26 +03:00
0cd8547e23
closes https://linear.app/tryghost/issue/IPC-115/make-skip-onboarding-button-work - show a confirmation modal when clicking the "Skip onboarding" button - onboarding is only dismissed when confirm button is clicked in the modal
46 lines
1.1 KiB
JavaScript
46 lines
1.1 KiB
JavaScript
import Component from '@glimmer/component';
|
|
import DismissModal from './onboarding/dismiss-modal';
|
|
import ShareModal from './onboarding/share-modal';
|
|
import {action} from '@ember/object';
|
|
import {inject} from 'ghost-admin/decorators/inject';
|
|
import {inject as service} from '@ember/service';
|
|
|
|
export default class OnboardingChecklist extends Component {
|
|
@service modals;
|
|
@service onboarding;
|
|
|
|
@inject config;
|
|
|
|
dismissModal = null;
|
|
shareModal = null;
|
|
|
|
willDestroy() {
|
|
super.willDestroy(...arguments);
|
|
this.dismissModal?.close();
|
|
this.shareModal?.close();
|
|
}
|
|
|
|
get siteUrl() {
|
|
return this.config.blogTitle;
|
|
}
|
|
|
|
@action
|
|
openShareModal() {
|
|
this.onboarding.markStepCompleted('share-publication');
|
|
this.shareModal = this.modals.open(ShareModal);
|
|
}
|
|
|
|
@action
|
|
async confirmDismiss() {
|
|
this.dismissModal = this.modals.open(DismissModal);
|
|
|
|
const reallyDismiss = await this.dismissModal;
|
|
|
|
if (reallyDismiss === true) {
|
|
this.onboarding.dismissChecklist();
|
|
} else {
|
|
this.dismissModal = null;
|
|
}
|
|
}
|
|
}
|