From 7cfdcfe17439279e83e30666fa57a406cfcd3c3d Mon Sep 17 00:00:00 2001 From: jack Date: Mon, 12 Jan 2026 16:04:12 -1000 Subject: [PATCH] Fix main actor isolation error in clearAppSwitcherSnapshots Add `nonisolated` to the static method since it only performs thread-safe FileManager operations and is called from Task.detached. Co-Authored-By: Claude Opus 4.5 --- bitchat/ViewModels/ChatViewModel.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitchat/ViewModels/ChatViewModel.swift b/bitchat/ViewModels/ChatViewModel.swift index 115ca77d..f3579bd8 100644 --- a/bitchat/ViewModels/ChatViewModel.swift +++ b/bitchat/ViewModels/ChatViewModel.swift @@ -2072,7 +2072,7 @@ final class ChatViewModel: ObservableObject, BitchatDelegate, CommandContextProv /// iOS stores preview screenshots in Library/Caches/Snapshots// /// These could reveal sensitive information visible in the app at the time #if os(iOS) - private static func clearAppSwitcherSnapshots() { + private nonisolated static func clearAppSwitcherSnapshots() { do { let cacheDir = try FileManager.default.url(for: .cachesDirectory, in: .userDomainMask, appropriateFor: nil, create: false) let snapshotsDir = cacheDir.appendingPathComponent("Snapshots", isDirectory: true)