mirror of
https://github.com/yattee/yattee.git
synced 2024-12-22 21:43:41 +00:00
Fix #84
This commit is contained in:
parent
6a65123876
commit
cc7bb83e74
@ -6,6 +6,7 @@ struct ChannelVideosView: View {
|
|||||||
|
|
||||||
@State private var presentingShareSheet = false
|
@State private var presentingShareSheet = false
|
||||||
@State private var shareURL: URL?
|
@State private var shareURL: URL?
|
||||||
|
@State private var subscriptionToggleButtonDisabled = false
|
||||||
|
|
||||||
@StateObject private var store = Store<Channel>()
|
@StateObject private var store = Store<Channel>()
|
||||||
|
|
||||||
@ -146,17 +147,25 @@ struct ChannelVideosView: View {
|
|||||||
if accounts.app.supportsSubscriptions && accounts.signedIn {
|
if accounts.app.supportsSubscriptions && accounts.signedIn {
|
||||||
if subscriptions.isSubscribing(channel.id) {
|
if subscriptions.isSubscribing(channel.id) {
|
||||||
Button("Unsubscribe") {
|
Button("Unsubscribe") {
|
||||||
navigation.presentUnsubscribeAlert(channel)
|
subscriptionToggleButtonDisabled = true
|
||||||
|
|
||||||
|
subscriptions.unsubscribe(channel.id) {
|
||||||
|
self.subscriptionToggleButtonDisabled = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Button("Subscribe") {
|
Button("Subscribe") {
|
||||||
|
subscriptionToggleButtonDisabled = true
|
||||||
|
|
||||||
subscriptions.subscribe(channel.id) {
|
subscriptions.subscribe(channel.id) {
|
||||||
|
subscriptionToggleButtonDisabled = false
|
||||||
navigation.sidebarSectionChanged.toggle()
|
navigation.sidebarSectionChanged.toggle()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.disabled(subscriptionToggleButtonDisabled)
|
||||||
}
|
}
|
||||||
|
|
||||||
private var contentItem: ContentItem {
|
private var contentItem: ContentItem {
|
||||||
|
Loading…
Reference in New Issue
Block a user