From f609ed1ed4ecf6ad082767500a15a6d25bccd6cd Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Fri, 17 Dec 2021 20:53:24 +0100 Subject: [PATCH] Fix unsubscribing from channel --- Shared/Views/ChannelVideosView.swift | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Shared/Views/ChannelVideosView.swift b/Shared/Views/ChannelVideosView.swift index 40d14dde..704063d4 100644 --- a/Shared/Views/ChannelVideosView.swift +++ b/Shared/Views/ChannelVideosView.swift @@ -160,6 +160,17 @@ struct ChannelVideosView: View { } } } + .alert(isPresented: $navigation.presentingUnsubscribeAlert) { + Alert( + title: Text( + "Are you sure you want to unsubscribe from \(channel.name)?" + ), + primaryButton: .destructive(Text("Unsubscribe")) { + subscriptions.unsubscribe(channel.id) + }, + secondaryButton: .cancel() + ) + } } private var contentItem: ContentItem {