fix: avoid main-actor stopCapture error
parent
41be9232fe
commit
65478a6ff3
|
|
@ -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) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue