1
0
mirror of https://github.com/mastodon/mastodon-ios.git synced 2025-02-03 10:47:35 +01:00

feat: Update block/mutes on block/mute action

This commit is contained in:
Marcus Kida 2022-11-24 21:23:18 +01:00
parent b1d92c69bd
commit bb30aae322
No known key found for this signature in database
GPG Key ID: 19FF64E08013CA40
2 changed files with 12 additions and 3 deletions

View File

@ -16,10 +16,17 @@ extension DataSourceFacade {
) async throws {
let selectionFeedbackGenerator = await UISelectionFeedbackGenerator()
await selectionFeedbackGenerator.selectionChanged()
_ = try await dependency.context.apiService.toggleBlock(
let apiService = dependency.context.apiService
let authBox = dependency.authContext.mastodonAuthenticationBox
_ = try await apiService.toggleBlock(
user: user,
authenticationBox: dependency.authContext.mastodonAuthenticationBox
authenticationBox: authBox
)
try await dependency.context.apiService.getBlocked(
authenticationBox: authBox
)
} // end func
}

View File

@ -97,6 +97,7 @@ extension APIService {
accountID: muteContext.targetUserID,
authorization: authenticationBox.userAuthorization
).singleOutput()
try await getMutes(authenticationBox: authenticationBox)
result = .success(response)
} else {
let response = try await Mastodon.API.Account.mute(
@ -105,6 +106,7 @@ extension APIService {
accountID: muteContext.targetUserID,
authorization: authenticationBox.userAuthorization
).singleOutput()
try await getMutes(authenticationBox: authenticationBox)
result = .success(response)
}
} catch {