Skip to content

Commit

Permalink
Adds error logic for one-time tip
Browse files Browse the repository at this point in the history
  • Loading branch information
NejcZdovc committed Jan 29, 2019
1 parent 6e2f5b2 commit 01e5294
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@
"description": "We show this string in the notification when you don't have enough funds for contribution"
},
"contributeNotificationTipError": {
"message": "There was a problem processing your tip, please try again.",
"message": "Unable to sent your tip. Please try again later.",
"description": "We show this string in notification when tip fails"
},
"noActivity": {
Expand Down
9 changes: 9 additions & 0 deletions vendor/bat-native-ledger/src/bat_contribution.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1526,6 +1526,15 @@ void BatContribution::AddRetry(
reconcile = ledger_->GetReconcileById(viewing_id);
}

// Don't retry one-time tip if in phase 1
if (GetRetryPhase(step) == 1 &&
reconcile.category_ == ledger::REWARDS_CATEGORY::DIRECT_DONATION) {
OnReconcileComplete(ledger::Result::TIP_ERROR,
viewing_id,
reconcile.category_);
return;
}

uint64_t start_timer_in = GetRetryTimer(step, viewing_id, reconcile);
bool success = ledger_->AddReconcileStep(viewing_id,
reconcile.retry_step_,
Expand Down

0 comments on commit 01e5294

Please sign in to comment.