handleOverageRejection method

void handleOverageRejection(
  1. String? reason
)

Called when a 429 indicates fast mode was rejected because extra usage is not available.

Implementation

void handleOverageRejection(String? reason) {
  final message = _getOverageDisabledMessage(reason);
  // Disable fast mode permanently unless the user has ran out of credits.
  if (!_isOutOfCreditsReason(reason)) {
    _config.updateSettingsForSource('userSettings', {'fastMode': null});
    _config.saveGlobalConfig(
      (current) => {...current, 'penguinModeOrgEnabled': false},
    );
  }
  overageRejection.emit(message);
}