mirror of
https://github.com/mastodon/mastodon-ios
synced 2025-04-11 22:58:02 +02:00
Update in-memory following/blocking states upon (un)follow/block action (IOS-140)
This commit is contained in:
parent
b8744c24fc
commit
3e6d75e1b5
Mastodon/Protocol/Provider
MastodonSDK/Sources/MastodonCore/Service
@ -28,5 +28,6 @@ extension DataSourceFacade {
|
||||
try await dependency.context.apiService.getBlocked(
|
||||
authenticationBox: authBox
|
||||
)
|
||||
dependency.context.authenticationService.fetchFollowingAndBlockedAsync()
|
||||
} // end func
|
||||
}
|
||||
|
@ -24,6 +24,7 @@ extension DataSourceFacade {
|
||||
user: user,
|
||||
authenticationBox: dependency.authContext.mastodonAuthenticationBox
|
||||
)
|
||||
dependency.context.authenticationService.fetchFollowingAndBlockedAsync()
|
||||
} // end func
|
||||
}
|
||||
|
||||
|
@ -67,6 +67,16 @@ public final class AuthenticationService: NSObject {
|
||||
return (ids, maxID)
|
||||
}
|
||||
|
||||
public func fetchFollowingAndBlockedAsync() {
|
||||
/// we're dispatching this as a separate async call to not block the callee
|
||||
Task {
|
||||
for authBox in mastodonAuthenticationBoxes {
|
||||
do { try await fetchFollowedBlockedUserIds(authBox) }
|
||||
catch {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public let updateActiveUserAccountPublisher = PassthroughSubject<Void, Never>()
|
||||
|
||||
init(
|
||||
|
Loading…
x
Reference in New Issue
Block a user