From 53310b52c1cd939f351ae03380e69b9aa7533dad Mon Sep 17 00:00:00 2001 From: Djordje Vlaisavljevic Date: Wed, 20 Mar 2024 20:31:05 +0000 Subject: [PATCH] Added function for copying publication link ref https://linear.app/tryghost/issue/IPC-90/add-share-modal --- ghost/admin/app/components/modal-share.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ghost/admin/app/components/modal-share.js b/ghost/admin/app/components/modal-share.js index cf4bf97252..60a1bdce3e 100644 --- a/ghost/admin/app/components/modal-share.js +++ b/ghost/admin/app/components/modal-share.js @@ -1,5 +1,15 @@ import ModalComponent from 'ghost-admin/components/modal-base'; +import copyTextToClipboard from 'ghost-admin/utils/copy-text-to-clipboard'; +import {inject} from 'ghost-admin/decorators/inject'; +import {task, timeout} from 'ember-concurrency'; export default ModalComponent.extend({ + config: inject(), -}); + copySiteUrl: task(function* () { + copyTextToClipboard(this.config.blogUrl); + yield timeout(1000); + return true; + }) + +}); \ No newline at end of file