Skip to content

Commit 1fe8baf

Browse files
committed
Add success popup message for copying share links
Signed-off-by: Christopher Ng <chrng8@gmail.com> (cherry picked from commit 08e1530)
1 parent 890da5a commit 1fe8baf

4 files changed

Lines changed: 14 additions & 9 deletions

File tree

apps/files_sharing/src/components/SharingEntryInternal.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
<script>
2424
import { generateUrl } from '@nextcloud/router'
25+
import { showSuccess } from '@nextcloud/dialogs'
2526
import NcActionLink from '@nextcloud/vue/dist/Components/NcActionLink'
2627
import SharingEntrySimple from './SharingEntrySimple'
2728
@@ -65,9 +66,10 @@ export default {
6566
*/
6667
clipboardTooltip() {
6768
if (this.copied) {
68-
return this.copySuccess
69-
? t('files_sharing', 'Link copied')
70-
: t('files_sharing', 'Cannot copy, please copy the link manually')
69+
if (this.copySuccess) {
70+
return ''
71+
}
72+
return t('files_sharing', 'Cannot copy, please copy the link manually')
7173
}
7274
return t('files_sharing', 'Copy to clipboard')
7375
},
@@ -84,6 +86,7 @@ export default {
8486
async copyLink() {
8587
try {
8688
await this.$copyText(this.internalLink)
89+
showSuccess(t('files_sharing', 'Link copied'))
8790
// focus and show the tooltip (note: cannot set ref on NcActionLink)
8891
this.$refs.shareEntrySimple.$refs.actionsComponent.$el.focus()
8992
this.copySuccess = true

apps/files_sharing/src/components/SharingEntryLink.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -564,9 +564,10 @@ export default {
564564
*/
565565
clipboardTooltip() {
566566
if (this.copied) {
567-
return this.copySuccess
568-
? t('files_sharing', 'Link copied')
569-
: t('files_sharing', 'Cannot copy, please copy the link manually')
567+
if (this.copySuccess) {
568+
return ''
569+
}
570+
return t('files_sharing', 'Cannot copy, please copy the link manually')
570571
}
571572
return t('files_sharing', 'Copy to clipboard')
572573
},
@@ -773,6 +774,7 @@ export default {
773774
async copyLink() {
774775
try {
775776
await this.$copyText(this.shareLink)
777+
showSuccess(t('files_sharing', 'Link copied'))
776778
// focus and show the tooltip
777779
this.$refs.copyButton.$el.focus()
778780
this.copySuccess = true

dist/files_sharing-files_sharing_tab.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/files_sharing-files_sharing_tab.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)