Feedback when copying playlist link (#1660)

* Show message when copying playlist URL

* Move toast to after writing to clipboard
This commit is contained in:
no-comma 2021-09-06 14:39:54 +00:00 committed by GitHub
parent 1fd36582ce
commit 065fc49db0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -100,12 +100,18 @@ export default Vue.extend({
switch (method) { switch (method) {
case 'copyYoutube': case 'copyYoutube':
navigator.clipboard.writeText(youtubeUrl) navigator.clipboard.writeText(youtubeUrl)
this.showToast({
message: this.$t('Share.YouTube URL copied to clipboard')
})
break break
case 'openYoutube': case 'openYoutube':
this.openExternalLink(youtubeUrl) this.openExternalLink(youtubeUrl)
break break
case 'copyInvidious': case 'copyInvidious':
navigator.clipboard.writeText(invidiousUrl) navigator.clipboard.writeText(invidiousUrl)
this.showToast({
message: this.$t('Share.Invidious URL copied to clipboard')
})
break break
case 'openInvidious': case 'openInvidious':
this.openExternalLink(invidiousUrl) this.openExternalLink(invidiousUrl)
@ -131,6 +137,7 @@ export default Vue.extend({
}, },
...mapActions([ ...mapActions([
'showToast',
'openExternalLink' 'openExternalLink'
]) ])
} }