From 08e15308cbb2e0dd3beefe4707de603d0af047fc Mon Sep 17 00:00:00 2001
From: Christopher Ng <chrng8@gmail.com>
Date: Sat, 26 Nov 2022 01:07:39 +0000
Subject: Add success popup message for copying share links

Signed-off-by: Christopher Ng <chrng8@gmail.com>
---
 apps/files_sharing/src/components/SharingEntryInternal.vue | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

(limited to 'apps/files_sharing/src/components/SharingEntryInternal.vue')

diff --git a/apps/files_sharing/src/components/SharingEntryInternal.vue b/apps/files_sharing/src/components/SharingEntryInternal.vue
index 9912648357c..7ad5b35c49f 100644
--- a/apps/files_sharing/src/components/SharingEntryInternal.vue
+++ b/apps/files_sharing/src/components/SharingEntryInternal.vue
@@ -23,6 +23,7 @@
 
 <script>
 import { generateUrl } from '@nextcloud/router'
+import { showSuccess } from '@nextcloud/dialogs'
 import { NcActionButton } from '@nextcloud/vue'
 import SharingEntrySimple from './SharingEntrySimple'
 
@@ -71,9 +72,10 @@ export default {
 		 */
 		clipboardTooltip() {
 			if (this.copied) {
-				return this.copySuccess
-					? t('files_sharing', 'Link copied')
-					: t('files_sharing', 'Cannot copy, please copy the link manually')
+				if (this.copySuccess) {
+					return ''
+				}
+				return t('files_sharing', 'Cannot copy, please copy the link manually')
 			}
 			return t('files_sharing', 'Copy to clipboard')
 		},
@@ -90,6 +92,7 @@ export default {
 		async copyLink() {
 			try {
 				await this.$copyText(this.internalLink)
+				showSuccess(t('files_sharing', 'Link copied'))
 				// focus and show the tooltip (note: cannot set ref on NcActionLink)
 				this.$refs.shareEntrySimple.$refs.actionsComponent.$el.focus()
 				this.copySuccess = true
-- 
cgit v1.2.3

