fix(Utils): dispatchToUIThread

This commit is contained in:
Nathan Walker
2022-06-04 10:11:24 -07:00
parent 80e6b8130a
commit 9089b2cf87
+6 -8
View File
@@ -8,12 +8,10 @@ export function isMainThread(): boolean {
export function dispatchToUIThread(func: () => void) {
const runloop = CFRunLoopGetMain();
return function (func) {
if (runloop && func) {
CFRunLoopPerformBlock(runloop, kCFRunLoopDefaultMode, func);
CFRunLoopWakeUp(runloop);
} else if (func) {
func();
}
};
if (runloop && func) {
CFRunLoopPerformBlock(runloop, kCFRunLoopDefaultMode, func);
CFRunLoopWakeUp(runloop);
} else if (func) {
func();
}
}