From 0bf29a4e610771df5357993353406a2f8925e4fb Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Fri, 19 Jun 2020 02:53:54 +1200 Subject: [PATCH] Share buttons use computed for URLs --- .../ft-share-button/ft-share-button.js | 49 ++++++++++--------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/src/renderer/components/ft-share-button/ft-share-button.js b/src/renderer/components/ft-share-button/ft-share-button.js index 9a1355ff..8b86f4dc 100644 --- a/src/renderer/components/ft-share-button/ft-share-button.js +++ b/src/renderer/components/ft-share-button/ft-share-button.js @@ -23,6 +23,23 @@ export default Vue.extend({ usingElectron: function () { return this.$store.getters.getUsingElectron }, + + invidiousURL() { + return `${this.invidiousInstance}/watch?v=${this.id}` + }, + + invidiousEmbedURL() { + return `${this.invidiousInstance}/embed/${this.id}` + }, + + youtubeURL() { + return `https://www.youtube.com/watch?v=${this.id}` + }, + + youtubeEmbedURL() { + return `https://www.youtube-nocookie.com/embed/${this.id}` + }, + }, methods: { copy(text) { @@ -36,52 +53,36 @@ export default Vue.extend({ } }, - getInvidiousURL() { - return `${this.invidiousInstance}/watch?v=${this.id}` - }, - - getInvidiousEmbedURL() { - return `${this.invidiousInstance}/embed/${this.id}` - }, - - getYoutubeURL() { - return `https://www.youtube.com/watch?v=${this.id}` - }, - - getYoutubeEmbedURL() { - return `https://www.youtube-nocookie.com/embed/${this.id}` - }, - openInvidious() { - this.open(this.getInvidiousURL()) + this.open(this.invidiousURL) }, copyInvidious() { - this.copy(this.getInvidiousURL()) + this.copy(this.invidiousURL) }, openYoutube() { - this.open(this.getYoutubeURL()) + this.open(this.youtubeURL) }, copyYoutube() { - this.copy(this.getYoutubeURL()) + this.copy(this.youtubeURL) }, openYoutubeEmbed() { - this.open(this.getYoutubeEmbedURL()) + this.open(this.youtubeEmbedURL) }, copyYoutubeEmbed() { - this.copy(this.getYoutubeEmbedURL()) + this.copy(this.youtubeEmbedURL) }, openInvidiousEmbed() { - this.open(this.getInvidiousEmbedURL()) + this.open(this.invidiousEmbedURL) }, copyInvidiousEmbed() { - this.copy(this.getInvidiousEmbedURL()) + this.copy(this.invidiousEmbedURL) }, } })