mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2025-01-11 08:35:26 +00:00
Fix logout
This commit is contained in:
parent
f73bac9ae7
commit
f55cadfbdd
2 changed files with 5 additions and 0 deletions
|
@ -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()
|
||||
}
|
||||
|
|
|
@ -78,6 +78,8 @@ struct SettingsTabs: View {
|
|||
let sub = pushNotifications.subscriptions.first(where: { $0.account.token == token })
|
||||
{
|
||||
Task {
|
||||
let client = Client(server: account.server, oauthToken: token)
|
||||
await TimelineCache.shared.clearCache(for: client)
|
||||
await sub.deleteSubscription()
|
||||
appAccountsManager.delete(account: account)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue