mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2025-06-06 05:48:50 +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 Models
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
import Timeline
|
import Timeline
|
||||||
|
import Network
|
||||||
|
|
||||||
struct AccountSettingsView: View {
|
struct AccountSettingsView: View {
|
||||||
@Environment(\.dismiss) private var dismiss
|
@Environment(\.dismiss) private var dismiss
|
||||||
|
@ -67,6 +68,8 @@ struct AccountSettingsView: View {
|
||||||
Button(role: .destructive) {
|
Button(role: .destructive) {
|
||||||
if let token = appAccount.oauthToken {
|
if let token = appAccount.oauthToken {
|
||||||
Task {
|
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 }) {
|
if let sub = pushNotifications.subscriptions.first(where: { $0.account.token == token }) {
|
||||||
await sub.deleteSubscription()
|
await sub.deleteSubscription()
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,6 +78,8 @@ struct SettingsTabs: View {
|
||||||
let sub = pushNotifications.subscriptions.first(where: { $0.account.token == token })
|
let sub = pushNotifications.subscriptions.first(where: { $0.account.token == token })
|
||||||
{
|
{
|
||||||
Task {
|
Task {
|
||||||
|
let client = Client(server: account.server, oauthToken: token)
|
||||||
|
await TimelineCache.shared.clearCache(for: client)
|
||||||
await sub.deleteSubscription()
|
await sub.deleteSubscription()
|
||||||
appAccountsManager.delete(account: account)
|
appAccountsManager.delete(account: account)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue