Fix concurrency error

Future work: Make MastodonAuthentication immutable and Sendable.
This commit is contained in:
shannon 2024-11-13 09:21:28 -05:00
parent 75d80ff382
commit 16f7a86374
1 changed files with 4 additions and 4 deletions

View File

@ -23,13 +23,13 @@ extension HomeTimelineViewModel {
accountCreationDate: accountCreatedAt)
else { return }
let seed = Mastodon.Entity.DonationCampaign.donationSeed(
username: userAuthentication.username,
domain: userAuthentication.domain)
Task { @MainActor [weak self] in
guard let self else { return }
let seed = Mastodon.Entity.DonationCampaign.donationSeed(
username: userAuthentication.username,
domain: userAuthentication.domain)
do {
let campaign = try await self.context.apiService
.getDonationCampaign(seed: seed, source: nil).value