mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-08-14 23:57:27 +00:00
Change some logic.
This commit is contained in:
parent
38938656dc
commit
0a8768194b
1 changed files with 5 additions and 10 deletions
|
@ -55,8 +55,8 @@
|
||||||
</a>
|
</a>
|
||||||
<router-link
|
<router-link
|
||||||
:to="toggleListenUrl"
|
:to="toggleListenUrl"
|
||||||
:aria-label="(isListening ? 'watch ' : 'listen to ') + video.title"
|
:aria-label="(isListening ? 'Watch ' : 'Listen to ') + video.title"
|
||||||
:title="(isListening ? 'watch ' : 'listen to ') + video.title"
|
:title="(isListening ? 'Watch ' : 'Listen to ') + video.title"
|
||||||
class="uk-margin-small-left uk-button uk-button-small"
|
class="uk-margin-small-left uk-button uk-button-small"
|
||||||
>
|
>
|
||||||
<font-awesome-icon icon="headphones"></font-awesome-icon>
|
<font-awesome-icon icon="headphones"></font-awesome-icon>
|
||||||
|
@ -318,15 +318,10 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
isListening(_this) {
|
|
||||||
const listenQueryParam = _this.$route.query.listen;
|
|
||||||
return listenQueryParam === "1";
|
|
||||||
},
|
|
||||||
toggleListenUrl(_this) {
|
toggleListenUrl(_this) {
|
||||||
const newUrl = _this.isListening
|
const url = new URL(window.location.href);
|
||||||
? _this.$route.fullPath.replace(/(listen=1&?)|(&?listen=1)/, "")
|
url.searchParams.set("listen", _this.getPreferenceBoolean("listen", false) ? "0" : "1");
|
||||||
: `${_this.$route.fullPath}&listen=1`;
|
return url.href;
|
||||||
return newUrl;
|
|
||||||
},
|
},
|
||||||
isEmbed(_this) {
|
isEmbed(_this) {
|
||||||
return String(_this.$route.path).indexOf("/embed/") == 0;
|
return String(_this.$route.path).indexOf("/embed/") == 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue