Improve sharing

This commit is contained in:
Arkadiusz Fal
2022-06-25 01:21:05 +02:00
parent 786418f82e
commit 634b0187ed
7 changed files with 107 additions and 126 deletions

View File

@@ -179,9 +179,20 @@ final class NavigationModel: ObservableObject {
presentingPlaylistForm = true
}
func presentUnsubscribeAlert(_ channel: Channel?) {
func presentUnsubscribeAlert(_ channel: Channel, subscriptions: SubscriptionsModel) {
channelToUnsubscribe = channel
presentingUnsubscribeAlert = channelToUnsubscribe != nil
alert = Alert(
title: Text(
"Are you sure you want to unsubscribe from \(channelToUnsubscribe.name)?"
),
primaryButton: .destructive(Text("Unsubscribe")) { [weak self] in
if let id = self?.channelToUnsubscribe.id {
subscriptions.unsubscribe(id)
}
},
secondaryButton: .cancel()
)
presentingAlert = true
}
func hideKeyboard() {