mirror of
				https://github.com/TeamPiped/Piped.git
				synced 2025-11-03 22:21:55 +00:00 
			
		
		
		
	Fix unsubscribe button in subscriptions page.
Only affects when unauthenticated.
This commit is contained in:
		@@ -63,16 +63,21 @@ export default {
 | 
			
		||||
            }
 | 
			
		||||
        },
 | 
			
		||||
        handleButton(subscription) {
 | 
			
		||||
            this.fetchJson(this.authApiUrl() + (subscription.subscribed ? "/unsubscribe" : "/subscribe"), null, {
 | 
			
		||||
                method: "POST",
 | 
			
		||||
                body: JSON.stringify({
 | 
			
		||||
                    channelId: subscription.url.split("/")[2],
 | 
			
		||||
                }),
 | 
			
		||||
                headers: {
 | 
			
		||||
                    Authorization: this.getAuthToken(),
 | 
			
		||||
                    "Content-Type": "application/json",
 | 
			
		||||
                },
 | 
			
		||||
            });
 | 
			
		||||
            const channelId = subscription.url.split("/")[2];
 | 
			
		||||
            if (this.authenticated) {
 | 
			
		||||
                this.fetchJson(this.authApiUrl() + (subscription.subscribed ? "/unsubscribe" : "/subscribe"), null, {
 | 
			
		||||
                    method: "POST",
 | 
			
		||||
                    body: JSON.stringify({
 | 
			
		||||
                        channelId: channelId,
 | 
			
		||||
                    }),
 | 
			
		||||
                    headers: {
 | 
			
		||||
                        Authorization: this.getAuthToken(),
 | 
			
		||||
                        "Content-Type": "application/json",
 | 
			
		||||
                    },
 | 
			
		||||
                });
 | 
			
		||||
            } else {
 | 
			
		||||
                this.handleLocalSubscriptions(channelId);
 | 
			
		||||
            }
 | 
			
		||||
            subscription.subscribed = !subscription.subscribed;
 | 
			
		||||
        },
 | 
			
		||||
        exportHandler() {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user