mirror of
https://github.com/yattee/yattee.git
synced 2026-10-27 06:57:18 +00:00
Keep destination checkmarks in sync with the main subscribe button
The main button's subscribe/unsubscribe never told the destination membership loader, so "Subscribe On…" kept a stale checkmark for the current account — and tapping that row would do the opposite of what the mark promised. Also: the menu item and success toast now name the account the write lands on when more than one destination is offered, and "Subscribe On…" no longer waits for the channel request — the cached header stands in until the load answers.
This commit is contained in:
@@ -85,6 +85,14 @@ final class SubscriptionDestinationMembershipLoader {
|
||||
|
||||
func isSubscribed(on context: DataContext) -> Bool? { membership.isSubscribed(on: context) }
|
||||
|
||||
/// The main subscribe button wrote to `context` behind these rows' back;
|
||||
/// without being told, the row for that context keeps the mark from before
|
||||
/// the write — and a tap on it would then do the opposite of what the mark
|
||||
/// promises.
|
||||
func noteToggled(_ context: DataContext, subscribed: Bool) {
|
||||
membership.record(subscribed, for: context, generation: membership.generation)
|
||||
}
|
||||
|
||||
func isBusy(_ context: DataContext) -> Bool { busy.contains(context) }
|
||||
|
||||
/// Asks about `channel`, from a place the SwiftUI lifecycle reaches.
|
||||
|
||||
Reference in New Issue
Block a user