ios: fix ocassional error on getSubsTotal (#5021)

This commit is contained in:
Diogo
2024-10-10 18:55:37 +01:00
committed by GitHub
parent df53ae9d4f
commit cebb4aa93b
@@ -437,7 +437,7 @@ struct SubsStatusIndicator: View {
private func startTask() {
task = Task {
while !Task.isCancelled {
if AppChatState.shared.value == .active {
if AppChatState.shared.value == .active, ChatModel.shared.chatRunning == true {
do {
let (subs, hasSess) = try await getAgentSubsTotal()
await MainActor.run {