Skip to content

Commit

Permalink
fix(bg/openPayments): redirect with right error on key-add failure
Browse files Browse the repository at this point in the history
  • Loading branch information
sidvishnoi committed Oct 2, 2024
1 parent 1edee22 commit 87e76d0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/background/services/openPayments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@ type TabRemovedCallback = Parameters<
const enum ErrorCode {
CONTINUATION_FAILED = 'continuation_failed',
HASH_FAILED = 'hash_failed',
KEY_ADD_FAILED = 'key_add_failed',
}

const enum GrantResult {
SUCCESS = 'grant_success',
ERROR = 'grant_error',
KEY_ADD_FAILED = 'key_add_failed',
}

const enum InteractionIntent {
Expand Down Expand Up @@ -564,9 +564,8 @@ export class OpenPaymentsService {
if (tabId && !isTabClosed) {
await this.redirectToWelcomeScreen(
tabId,
GrantResult.ERROR,
GrantResult.KEY_ADD_FAILED,
InteractionIntent.CONNECT,
ErrorCode.KEY_ADD_FAILED,
);
}
if (error instanceof ErrorWithKey) {
Expand Down

0 comments on commit 87e76d0

Please sign in to comment.