mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-08-14 23:57:27 +00:00
Fix unsubscribe button in subscriptions page.
Only affects when unauthenticated.
This commit is contained in:
parent
c51a3a828e
commit
e0cf9e6182
1 changed files with 15 additions and 10 deletions
|
@ -63,16 +63,21 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleButton(subscription) {
|
handleButton(subscription) {
|
||||||
this.fetchJson(this.authApiUrl() + (subscription.subscribed ? "/unsubscribe" : "/subscribe"), null, {
|
const channelId = subscription.url.split("/")[2];
|
||||||
method: "POST",
|
if (this.authenticated) {
|
||||||
body: JSON.stringify({
|
this.fetchJson(this.authApiUrl() + (subscription.subscribed ? "/unsubscribe" : "/subscribe"), null, {
|
||||||
channelId: subscription.url.split("/")[2],
|
method: "POST",
|
||||||
}),
|
body: JSON.stringify({
|
||||||
headers: {
|
channelId: channelId,
|
||||||
Authorization: this.getAuthToken(),
|
}),
|
||||||
"Content-Type": "application/json",
|
headers: {
|
||||||
},
|
Authorization: this.getAuthToken(),
|
||||||
});
|
"Content-Type": "application/json",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.handleLocalSubscriptions(channelId);
|
||||||
|
}
|
||||||
subscription.subscribed = !subscription.subscribed;
|
subscription.subscribed = !subscription.subscribed;
|
||||||
},
|
},
|
||||||
exportHandler() {
|
exportHandler() {
|
||||||
|
|
Loading…
Reference in a new issue