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

feat(background): store spent amount on payment to retrieve balance #386

Merged
merged 5 commits into from
Jul 4, 2024

Conversation

sidvishnoi
Copy link
Member

@sidvishnoi sidvishnoi commented Jul 2, 2024

Context

Closes #272.

Changes proposed in this pull request

Saves grantSpentDebitAmount as "amountSpent" in storage, which we can later use to retrieve balance. To handle race conditions, we store the max of amount spent in the batch of multiple (possibly parallel) calls.

Extracted from #379, but using throttling instead of debouncing.

@github-actions github-actions bot added the area: background Improvements or additions to extension background script label Jul 2, 2024
@raducristianpopa
Copy link
Member

raducristianpopa commented Jul 2, 2024

Extension builds preview

Name Link
Latest commit 281e3ee
Latest job logs Run #9792240086
BadgeDownload
BadgeDownload

@sidvishnoi
Copy link
Member Author

sidvishnoi commented Jul 2, 2024

Shows up fine in Setting screen

image

Rest of UI do be done under #378

@sidvishnoi sidvishnoi requested review from raducristianpopa and dianafulga and removed request for raducristianpopa July 2, 2024 11:56
Copy link
Member

@raducristianpopa raducristianpopa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two comments:

src/background/services/openPayments.ts Outdated Show resolved Hide resolved
src/background/services/storage.ts Outdated Show resolved Hide resolved
@sidvishnoi sidvishnoi merged commit 7df43c3 into main Jul 4, 2024
8 checks passed
@sidvishnoi sidvishnoi deleted the update-balance branch July 4, 2024 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: background Improvements or additions to extension background script
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show remaining balance of authorized amnt
2 participants