mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-11-14 04:08:21 +00:00
Merge pull request #1274 from Bnyro/unauth-subs
fix unauthenticated subscribe status
This commit is contained in:
commit
c37b5390cf
@ -49,7 +49,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
channel: null,
|
channel: null,
|
||||||
subscribed: this.authenticated ? false : this.isSubscribedLocally(this.channelId),
|
subscribed: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
@ -68,7 +68,11 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async fetchSubscribedStatus() {
|
async fetchSubscribedStatus() {
|
||||||
if (!this.channelId || !this.authenticated) return;
|
if (!this.channel.id) return;
|
||||||
|
if (!this.authenticated) {
|
||||||
|
this.subscribed = this.isSubscribedLocally(this.channel.id);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.fetchJson(
|
this.fetchJson(
|
||||||
this.authApiUrl() + "/subscribed",
|
this.authApiUrl() + "/subscribed",
|
||||||
@ -94,7 +98,7 @@ export default {
|
|||||||
.then(() => {
|
.then(() => {
|
||||||
if (!this.channel.error) {
|
if (!this.channel.error) {
|
||||||
document.title = this.channel.name + " - Piped";
|
document.title = this.channel.name + " - Piped";
|
||||||
if (this.authenticated) this.fetchSubscribedStatus();
|
this.fetchSubscribedStatus();
|
||||||
this.updateWatched(this.channel.relatedStreams);
|
this.updateWatched(this.channel.relatedStreams);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -427,7 +427,10 @@ export default {
|
|||||||
},
|
},
|
||||||
async fetchSubscribedStatus() {
|
async fetchSubscribedStatus() {
|
||||||
if (!this.channelId) return;
|
if (!this.channelId) return;
|
||||||
if (!this.authenticated) this.subscribed = this.isSubscribedLocally(this.channelId);
|
if (!this.authenticated) {
|
||||||
|
this.subscribed = this.isSubscribedLocally(this.channelId);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.fetchJson(
|
this.fetchJson(
|
||||||
this.authApiUrl() + "/subscribed",
|
this.authApiUrl() + "/subscribed",
|
||||||
|
Loading…
Reference in New Issue
Block a user