Fix bad callback thread in restore purchases
This commit is contained in:
parent
6c84217a0f
commit
9566bac598
|
@ -294,14 +294,18 @@ extension ProductManager: SKRequestDelegate {
|
|||
guard finished else {
|
||||
return
|
||||
}
|
||||
self?.restoreCompletionHandler?(error)
|
||||
self?.restoreCompletionHandler = nil
|
||||
DispatchQueue.main.async {
|
||||
self?.restoreCompletionHandler?(error)
|
||||
self?.restoreCompletionHandler = nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public func request(_ request: SKRequest, didFailWithError error: Error) {
|
||||
restoreCompletionHandler?(error)
|
||||
restoreCompletionHandler = nil
|
||||
DispatchQueue.main.async { [weak self] in
|
||||
self?.restoreCompletionHandler?(error)
|
||||
self?.restoreCompletionHandler = nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue