diff --git a/IceCubesApp/App/Tabs/Settings/AccountSettingView.swift b/IceCubesApp/App/Tabs/Settings/AccountSettingView.swift index e1cf3493..d80b16a3 100644 --- a/IceCubesApp/App/Tabs/Settings/AccountSettingView.swift +++ b/IceCubesApp/App/Tabs/Settings/AccountSettingView.swift @@ -5,6 +5,7 @@ import Env import Models import SwiftUI import Timeline +import Network struct AccountSettingsView: View { @Environment(\.dismiss) private var dismiss @@ -67,6 +68,8 @@ struct AccountSettingsView: View { Button(role: .destructive) { if let token = appAccount.oauthToken { Task { + let client = Client(server: appAccount.server, oauthToken: token) + await TimelineCache.shared.clearCache(for: client) if let sub = pushNotifications.subscriptions.first(where: { $0.account.token == token }) { await sub.deleteSubscription() } diff --git a/Packages/Lists/Sources/Lists/Edit/ListEditView.swift b/Packages/Lists/Sources/Lists/Edit/ListEditView.swift index f55cadba..8806950f 100644 --- a/Packages/Lists/Sources/Lists/Edit/ListEditView.swift +++ b/Packages/Lists/Sources/Lists/Edit/ListEditView.swift @@ -39,13 +39,6 @@ public struct ListEditView: View { } } .listRowBackground(theme.primaryBackgroundColor) - }.onDelete { indexes in - if let index = indexes.first { - Task { - let account = viewModel.accounts[index] - await viewModel.delete(account: account) - } - } } } } diff --git a/Packages/Lists/Sources/Lists/Edit/ListEditViewModel.swift b/Packages/Lists/Sources/Lists/Edit/ListEditViewModel.swift index cac0b84c..61082f63 100644 --- a/Packages/Lists/Sources/Lists/Edit/ListEditViewModel.swift +++ b/Packages/Lists/Sources/Lists/Edit/ListEditViewModel.swift @@ -25,14 +25,4 @@ public class ListEditViewModel: ObservableObject { isLoadingAccounts = false } } - - func delete(account: Account) async { - guard let client else { return } - do { - let response = try await client.delete(endpoint: Lists.updateAccounts(listId: list.id, accounts: [account.id])) - if response?.statusCode == 200 { - accounts.removeAll(where: { $0.id == account.id }) - } - } catch {} - } }