fix: APP-491 empty choose credits form appears for ms#2591
Conversation
✅ Deploy Preview for terrasos ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for regen-website ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
|
|
||
| const availableSellOrders = allSellOrders?.filter( | ||
| (sellOrder: SellOrderInfo) => | ||
| sellOrder.seller !== activeAccount?.addr && |
There was a problem hiding this comment.
best to check wallet?.addr which is the addr currently connected, because if the user is connected with wallet connect, activeAccount?.addr will be empty
|
@erikalogie @S4mmyb see testing instructions |
|
LGTM |
| const activeAccount = authenticatedAccounts.find( | ||
| account => account?.id === activeAccountId, | ||
| ); | ||
| currentActiveAddress = activeAccount?.addr ?? undefined; |
There was a problem hiding this comment.
I still see the empty choose credits form when logged in with wallet connect, this is because here we check the activeAccount?.addr instead of wallet?.addr
see my previous comment: #2591 (comment)
There was a problem hiding this comment.
We are checkingwallet?.addr as well. The issue was that we weren't passing the address param to getRegenRouter. Although, I'm not fetching the activeAccount?.addr anymore because I have updated BuyCredits.loader.ts and Regen.Routes.tsx to use activeWalletAddr instead of wallet as activeAccount?.addr is checked in useWallet().
Note that the ternary in the dashboard route that is using address was always pointing to /projects because there was no address param, so that should be fixed too.
647cdd2 to
6a6c779
Compare
| }; | ||
| /** | ||
| * Loader function for the Buy Credits page that checks if there are available | ||
| * sell orders in a given project for a given account address |
There was a problem hiding this comment.
we could clarify that there are available sell orders if the current account address is not the seller of all available sell orders
There was a problem hiding this comment.
Thanks! And good point, I've updated the comment to make it clearer.
beb0b4e to
bb54dde
Compare
Description
https://regennetwork.atlassian.net/browse/APP-491
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
How to test
/buyat the end. i.e https://deploy-preview-2591--regen-marketplace.netlify.app/project/C01-010/buyReviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...