handlePurchaseProductFailedEvent method

Stream<FastStoreBlocState> handlePurchaseProductFailedEvent(
  1. dynamic error
)

Handles the FastStoreBlocEventType.purchaseProductFailed event when purchasing a product has failed.

Implementation

Stream<FastStoreBlocState> handlePurchaseProductFailedEvent(
  dynamic error,
) async* {
  if (_isPurchasePending) {
    _logger.error('Restoring purchases failed: $error');
    _isPurchasePending = false;
    _pendingPurchaseProductId = null;

    yield currentState.copyWith(error: error, isPurchasePending: false);
  }
}