Make sure posthog runs on main thread
This commit is contained in:
@ -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) }
|
||||
|
||||
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user