mirror of
https://github.com/mastodon/mastodon-ios
synced 2025-04-11 22:58:02 +02:00
Only publish new active user if it has changed, and only fetch info for current user.
contributes to iOS-319
This commit is contained in:
parent
96e3bec016
commit
d96be97cf6
@ -28,12 +28,12 @@ public class AuthenticationServiceProvider: ObservableObject {
|
||||
$mastodonAuthenticationBoxes
|
||||
.throttle(for: 3, scheduler: DispatchQueue.main, latest: true)
|
||||
.sink { [weak self] boxes in
|
||||
self?.currentActiveUser.send(boxes.first)
|
||||
let nowActive = boxes.first
|
||||
guard nowActive?.authentication != self?.currentActiveUser.value?.authentication else { return }
|
||||
self?.currentActiveUser.send(nowActive)
|
||||
guard let nowActive = nowActive else { return }
|
||||
Task { [weak self] in
|
||||
for authBox in boxes {
|
||||
do { try await self?.fetchFollowedBlockedUserIds(authBox) }
|
||||
catch {}
|
||||
}
|
||||
try await self?.fetchFollowedBlockedUserIds(nowActive)
|
||||
}
|
||||
}
|
||||
.store(in: &disposeBag)
|
||||
|
Loading…
x
Reference in New Issue
Block a user