Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(background): use correct intent in completeGrant for add funds #537

Merged
merged 2 commits into from
Aug 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
sidvishnoi marked this conversation as resolved.
Show resolved Hide resolved
)

// 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