Skip to content

Commit 02121dc

Browse files
committed
Make sure to invalidate all Accounts to include those who are off screen and not associated with a Row.
1 parent 503dc32 commit 02121dc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Authenticator/Model/MainViewModel.swift

+6
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ class MainViewModel: ObservableObject {
9393
await MainActor.run { [weak self] in
9494
self?.favoritesCancellables.forEach { $0.cancel() }
9595
self?.favoritesCancellables.removeAll()
96+
self?.accounts.forEach { account in
97+
account.invalidate()
98+
}
9699
self?.accounts.removeAll()
97100
self?.pinnedAccounts.removeAll()
98101
self?.otherAccounts.removeAll()
@@ -114,6 +117,9 @@ class MainViewModel: ObservableObject {
114117
@MainActor func stop() {
115118
sessionTask?.cancel()
116119
sessionTask = nil
120+
accounts.forEach { account in
121+
account.invalidate()
122+
}
117123
accounts.removeAll()
118124
pinnedAccounts.removeAll()
119125
otherAccounts.removeAll()

0 commit comments

Comments
 (0)