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 <noreply@anthropic.com>
This commit is contained in:
jack
2026-01-12 16:04:12 -10:00
co-authored by Claude Opus 4.5
parent 21e0cbc607
commit 7cfdcfe174
+1 -1
View File
@@ -2072,7 +2072,7 @@ final class ChatViewModel: ObservableObject, BitchatDelegate, CommandContextProv
/// iOS stores preview screenshots in Library/Caches/Snapshots/<bundle_id>/
/// 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)