feat: Update block/mutes on block/mute action
This commit is contained in:
parent
b1d92c69bd
commit
bb30aae322
|
@ -16,10 +16,17 @@ extension DataSourceFacade {
|
||||||
) async throws {
|
) async throws {
|
||||||
let selectionFeedbackGenerator = await UISelectionFeedbackGenerator()
|
let selectionFeedbackGenerator = await UISelectionFeedbackGenerator()
|
||||||
await selectionFeedbackGenerator.selectionChanged()
|
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,
|
user: user,
|
||||||
authenticationBox: dependency.authContext.mastodonAuthenticationBox
|
authenticationBox: authBox
|
||||||
|
)
|
||||||
|
|
||||||
|
try await dependency.context.apiService.getBlocked(
|
||||||
|
authenticationBox: authBox
|
||||||
)
|
)
|
||||||
} // end func
|
} // end func
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,6 +97,7 @@ extension APIService {
|
||||||
accountID: muteContext.targetUserID,
|
accountID: muteContext.targetUserID,
|
||||||
authorization: authenticationBox.userAuthorization
|
authorization: authenticationBox.userAuthorization
|
||||||
).singleOutput()
|
).singleOutput()
|
||||||
|
try await getMutes(authenticationBox: authenticationBox)
|
||||||
result = .success(response)
|
result = .success(response)
|
||||||
} else {
|
} else {
|
||||||
let response = try await Mastodon.API.Account.mute(
|
let response = try await Mastodon.API.Account.mute(
|
||||||
|
@ -105,6 +106,7 @@ extension APIService {
|
||||||
accountID: muteContext.targetUserID,
|
accountID: muteContext.targetUserID,
|
||||||
authorization: authenticationBox.userAuthorization
|
authorization: authenticationBox.userAuthorization
|
||||||
).singleOutput()
|
).singleOutput()
|
||||||
|
try await getMutes(authenticationBox: authenticationBox)
|
||||||
result = .success(response)
|
result = .success(response)
|
||||||
}
|
}
|
||||||
} catch {
|
} catch {
|
||||||
|
|
Loading…
Reference in New Issue