Files
lnreader/modules/nitro-tts/ios/MainQueuePromise.swift
Rajarshee Chatterjee 74808f086e feat: Replace Legacy Media Controls with Nitro-Powered Playback (#1896)
* feat: Replace Legacy Media Controls with Nitro-Powered Playback

* feat: Add TTS Engine Selection

* chore: Remove User-Facing Error Reporting

* refactor: Combine `Tts` and `TtsSession` Imports from `nitro-tts` Module

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-07-24 23:42:17 +05:30

18 lines
364 B
Swift

import Foundation
import NitroModules
enum MainQueuePromise {
static func run(_ operation: @escaping () throws -> Void) -> Promise<Void> {
let promise = Promise<Void>()
DispatchQueue.main.async {
do {
try operation()
promise.resolve()
} catch {
promise.reject(withError: error)
}
}
return promise
}
}