more fixes for tests
iOS CI / Build and Test SwiftUI App (push) Canceled after 0s
Build Unsigned iOS and macOS Apps / Build Unsigned iOS IPA (push) Canceled after 0s
Build Unsigned iOS and macOS Apps / Build macOS ZIP (push) Canceled after 0s

This commit is contained in:
wt committed 2026-08-11 15:42:01 +07:00
1 parent 2558f722fc
commit 88616124b6
4 files changed
+60 -9

No files matched your search

+16 -3
View File
@@ -4,6 +4,14 @@ import Foundation
import UniformTypeIdentifiers
import WebRTC
enum RuntimeEnvironment {
static var isRunningTests: Bool {
let environment = ProcessInfo.processInfo.environment
return environment["XCTestConfigurationFilePath"] != nil
|| environment["XCTestBundlePath"] != nil
}
}
@MainActor
final class AppModel: ObservableObject {
@Published private(set) var account: AccountConfiguration?
@@ -186,9 +194,11 @@ final class AppModel: ObservableObject {
}
}
bootstrapTask = Task { [weak self] in
guard let self else { return }
await self.bootstrap()
if !RuntimeEnvironment.isRunningTests {
bootstrapTask = Task { [weak self] in
guard let self else { return }
await self.bootstrap()
}
}
}
@@ -242,6 +252,7 @@ final class AppModel: ObservableObject {
}
func bootstrap() async {
guard !RuntimeEnvironment.isRunningTests else { return }
guard let saved = preferences.load() else { return }
account = saved
globalEncryptionEnabled = preferences.encryptionEnabled(for: saved.normalizedJID)
@@ -376,6 +387,7 @@ final class AppModel: ObservableObject {
}
func reconnect() async {
guard !RuntimeEnvironment.isRunningTests else { return }
guard let account else { return }
do {
guard let password = try credentials.password(for: account.normalizedJID) else {
@@ -390,6 +402,7 @@ final class AppModel: ObservableObject {
func setApplicationActive(_ active: Bool) {
appIsActive = active
guard !RuntimeEnvironment.isRunningTests else { return }
xmpp.setApplicationActive(active)
if !active {
resetTypingState()