Skip to content

Commit

Permalink
fix(background): use correct intent in completeGrant for add funds (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
raducristianpopa authored Aug 23, 2024
1 parent 0e8941b commit fb893a7
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/background/services/openPayments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,12 @@ export class OpenPaymentsService {
})

await this.initClient(walletAddress.id)
await this.completeGrant(amount, walletAddress, recurring)
await this.completeGrant(
amount,
walletAddress,
recurring,
InteractionIntent.CONNECT
)

await this.storage.set({
walletAddress,
Expand All @@ -359,7 +364,12 @@ export class OpenPaymentsService {
'recurringGrant'
])

await this.completeGrant(amount, walletAddress!, recurring)
await this.completeGrant(
amount,
walletAddress!,
recurring,
InteractionIntent.FUNDS
)

// cancel existing grants of same type, if any
if (grants.oneTimeGrant && !recurring) {
Expand All @@ -375,7 +385,7 @@ export class OpenPaymentsService {
amount: string,
walletAddress: WalletAddress,
recurring: boolean,
intent: InteractionIntent = InteractionIntent.CONNECT
intent: InteractionIntent
): Promise<GrantDetails> {
const transformedAmount = toAmount({
value: amount,
Expand Down

0 comments on commit fb893a7

Please sign in to comment.