fix: avoid main-actor stopCapture error

This commit is contained in:
Peter Steinberger
2025-12-29 20:20:14 +01:00
parent 41be9232fe
commit 65478a6ff3

View File

@@ -180,8 +180,8 @@ final class ScreenRecordService {
try await Task.sleep(nanoseconds: UInt64(durationMs) * 1_000_000) try await Task.sleep(nanoseconds: UInt64(durationMs) * 1_000_000)
let stopError = await MainActor.run { let stopError = await withCheckedContinuation { cont in
await withCheckedContinuation { cont in Task { @MainActor in
recorder.stopCapture { error in cont.resume(returning: error) } recorder.stopCapture { error in cont.resume(returning: error) }
} }
} }