Make sure posthog runs on main thread

This commit is contained in:
Jackson Harper
2024-07-12 15:18:18 +08:00
parent 4d92643c33
commit 7ac3729a72
2 changed files with 4 additions and 1 deletions

View File

@ -10,6 +10,7 @@ public enum GoogleAuthResponse {
}
extension Authenticator {
@MainActor
public func handleGoogleAuth(presentingVC: PlatformViewController?) async -> GoogleAuthResponse {
let idToken = await withCheckedContinuation { continuation in
googleSignIn(presenting: presentingVC) { continuation.resume(returning: $0) }

View File

@ -82,7 +82,6 @@ public struct ViewerInternal {
do {
try context.save()
EventTracker.registerUser(userID: userID)
logger.debug("Viewer saved succesfully")
} catch {
context.rollback()
@ -90,5 +89,8 @@ public struct ViewerInternal {
throw error
}
}
DispatchQueue.main.async {
EventTracker.registerUser(userID: userID)
}
}
}