Skip to content

feat: APP-441 update account name during buy credits flow#2596

Merged
r41ph merged 4 commits intodevfrom
feat-APP-441-save-account-name-on-purchase
Feb 24, 2025
Merged

feat: APP-441 update account name during buy credits flow#2596
r41ph merged 4 commits intodevfrom
feat-APP-441-save-account-name-on-purchase

Conversation

@r41ph
Copy link
Contributor

@r41ph r41ph commented Feb 10, 2025

Description

https://regennetwork.atlassian.net/browse/APP-441

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

  • provided a link to the relevant issue or specification
  • provided instructions on how to test
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

How to test

  1. Create a new user without adding a name.
  2. Go to the buy credits flow and buy credits adding a name.
  3. Verify in the user's profile edit page that the name has been updated with the name given during credits purchase.

Reviewers 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...

  • confirmed all author checklist items have been addressed
  • reviewed code correctness and readability
  • verified React components follow DRY principles
  • reviewed documentation is accurate
  • reviewed tests
  • manually tested (if applicable)

@netlify
Copy link

netlify bot commented Feb 10, 2025

Deploy Preview for regen-website ready!

Name Link
🔨 Latest commit 0b260ea
🔍 Latest deploy log https://app.netlify.com/sites/regen-website/deploys/67bc498c6ad9cc00081194ac
😎 Deploy Preview https://deploy-preview-2596--regen-website.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@netlify
Copy link

netlify bot commented Feb 10, 2025

Deploy Preview for terrasos ready!

Name Link
🔨 Latest commit 0b260ea
🔍 Latest deploy log https://app.netlify.com/sites/terrasos/deploys/67bc498c7e2ac50008f84e18
😎 Deploy Preview https://deploy-preview-2596--terrasos.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@r41ph r41ph requested a review from blushi February 10, 2025 13:39
@r41ph
Copy link
Contributor Author

r41ph commented Feb 10, 2025

@erikalogie @S4mmyb see testing instructions.

@erikalogie
Copy link
Collaborator

This does not seem to be working, the name I provided appears on the credit retirement certificate but not in the user dropdown, or on the user profile
Screenshot 2025-02-10 at 10 11 01 AM
Screenshot 2025-02-10 at 10 11 14 AM

});
}

if (name && !activeAccount?.name && !noAccountAndNoWallet) {
Copy link
Member

@blushi blushi Feb 10, 2025

Choose a reason for hiding this comment

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

you will also need to invalidate the getAccount query, see how it's done in refreshProfileData in ProfileEditMain

Copy link
Member

Choose a reason for hiding this comment

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

you can just check !!activeAccount instead of !noAccountAndNoWallet

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this should happen for logged in users

I believe that logic checks if the user is logged in

Copy link
Member

@blushi blushi Feb 10, 2025

Choose a reason for hiding this comment

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

I've updated my comment, check the new comment above
you should only check for activeAccount
we don't care about a wallet being there or not in this case

Copy link
Member

Choose a reason for hiding this comment

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

you will also need to invalidate the getAccount query, see how it's done in refreshProfileData in ProfileEditMain

@r41ph this still needs to be addressed, for the name update to appear without reloading the page

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@blushi have a look please

@r41ph
Copy link
Contributor Author

r41ph commented Feb 10, 2025

This does not seem to be working, the name I provided appears on the credit

@erikalogie I've just tried it again and it seems to be working as expected. Can you share more about how you are testing it please?

@erikalogie
Copy link
Collaborator

This does not seem to be working, the name I provided appears on the credit

@erikalogie I've just tried it again and it seems to be working as expected. Can you share more about how you are testing it please?

I made a new email account and then went through the buy flow. I just tried it again and it is working now.

@S4mmyb
Copy link
Member

S4mmyb commented Feb 11, 2025

this worked for me

@r41ph r41ph force-pushed the feat-APP-441-save-account-name-on-purchase branch from f9fa9d5 to c8a1899 Compare February 11, 2025 13:01
@r41ph r41ph requested a review from blushi February 11, 2025 13:14
@r41ph r41ph force-pushed the feat-APP-441-save-account-name-on-purchase branch from c8a1899 to 3d92c57 Compare February 12, 2025 17:27
Copy link
Member

@blushi blushi left a comment

Choose a reason for hiding this comment

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

Pre-approving, pending small adjustment

}

if (name && activeAccount?.id && !activeAccount?.name) {
updateAccountById({
Copy link
Member

Choose a reason for hiding this comment

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

best to wait for this to succeed before refreshing profile data

Suggested change
updateAccountById({
await updateAccountById({

@r41ph r41ph force-pushed the feat-APP-441-save-account-name-on-purchase branch from 3d92c57 to 0b260ea Compare February 24, 2025 10:27
@r41ph r41ph merged commit 661ff7f into dev Feb 24, 2025
18 checks passed
@r41ph r41ph deleted the feat-APP-441-save-account-name-on-purchase branch February 24, 2025 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants