Ghost/ghost/admin/app/components/modal-post-preview/browser.js

13 lines
438 B
JavaScript
Raw Normal View History

import Component from '@glimmer/component';
import copyTextToClipboard from 'ghost-admin/utils/copy-text-to-clipboard';
import {task} from 'ember-concurrency-decorators';
import {timeout} from 'ember-concurrency';
export default class ModalPostPreviewBrowserComponent extends Component {
@task
*copyPreviewUrl() {
copyTextToClipboard(this.args.post.previewUrl);
yield timeout(this.isTesting ? 50 : 3000);
}
}