Skip to content

Commit

Permalink
Remove unecessary workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimillian committed Aug 13, 2024
1 parent fca7684 commit 5a8862b
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 15 deletions.
1 change: 0 additions & 1 deletion IceCubesApp/App/Report/ReportView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public struct ReportView: View {
ToolbarItem(placement: .navigationBarTrailing) {
Button {
isSendingReport = true
let client = client
Task {
do {
let _: ReportSent =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ public struct AccountDetailContextMenu: View {

if viewModel.relationship?.blocking == true {
Button {
let client = client
Task {
do {
viewModel.relationship = try await client.post(endpoint: Accounts.unblock(id: account.id))
Expand All @@ -54,7 +53,6 @@ public struct AccountDetailContextMenu: View {

if viewModel.relationship?.muting == true {
Button {
let client = client
Task {
do {
viewModel.relationship = try await client.post(endpoint: Accounts.unmute(id: account.id))
Expand All @@ -67,7 +65,6 @@ public struct AccountDetailContextMenu: View {
Menu {
ForEach(Duration.mutingDurations(), id: \.rawValue) { duration in
Button(duration.description) {
let client = client
Task {
do {
viewModel.relationship = try await client.post(endpoint: Accounts.mute(id: account.id, json: MuteData(duration: duration.rawValue)))
Expand All @@ -85,7 +82,6 @@ public struct AccountDetailContextMenu: View {
{
if relationship.notifying {
Button {
let client = client
Task {
do {
viewModel.relationship = try await client.post(endpoint: Accounts.follow(id: account.id,
Expand All @@ -98,7 +94,6 @@ public struct AccountDetailContextMenu: View {
}
} else {
Button {
let client = client
Task {
do {
viewModel.relationship = try await client.post(endpoint: Accounts.follow(id: account.id,
Expand All @@ -112,7 +107,6 @@ public struct AccountDetailContextMenu: View {
}
if relationship.showingReblogs {
Button {
let client = client
Task {
do {
viewModel.relationship = try await client.post(endpoint: Accounts.follow(id: account.id,
Expand All @@ -125,7 +119,6 @@ public struct AccountDetailContextMenu: View {
}
} else {
Button {
let client = client
Task {
do {
viewModel.relationship = try await client.post(endpoint: Accounts.follow(id: account.id,
Expand Down
1 change: 0 additions & 1 deletion Packages/Account/Sources/Account/AccountDetailView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,6 @@ public struct AccountDetailView: View {
.confirmationDialog("Block User", isPresented: $showBlockConfirmation) {
if let account = viewModel.account {
Button("account.action.block-user-\(account.username)", role: .destructive) {
let client = client
Task {
do {
viewModel.relationship = try await client.post(endpoint: Accounts.block(id: account.id))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ public struct FiltersListView: View {
.background(theme.secondaryBackgroundColor)
#endif
.task {
let client = client
do {
isLoading = true
filters = try await client.get(endpoint: ServerFilters.filters, forceVersion: .v2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ public struct AccountDetailMediaGridView: View {
}

private func fetchNextPage() async throws {
let client = client
let newStatuses: [Status] =
try await client.get(endpoint: Accounts.statuses(id: account.id,
sinceId: mediaStatuses.last?.id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ struct ConversationMessageView: View {
Label("status.action.copy-text", systemImage: "doc.on.doc")
}
Button {
let client = client
Task {
do {
let status: Status
Expand All @@ -127,7 +126,6 @@ struct ConversationMessageView: View {
systemImage: isLiked ? "star.fill" : "star")
}
Button {
let client = client
Task {
do {
let status: Status
Expand All @@ -147,7 +145,6 @@ struct ConversationMessageView: View {
Divider()
if message.account.id == currentAccount.account?.id {
Button("status.action.delete", role: .destructive) {
let client = client
Task {
_ = try await client.delete(endpoint: Statuses.status(id: message.id))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ public struct StatusRowView: View {
isPresented: $isBlockConfirmationPresented)
{
Button("account.action.block", role: .destructive) {
let client = client
Task {
do {
let operationAccount = viewModel.status.reblog?.account ?? viewModel.status.account
Expand Down

0 comments on commit 5a8862b

Please sign in to comment.