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(frontend): load user profile during login #5460

Merged
merged 11 commits into from
Mar 28, 2025

Conversation

AntonioVentilii
Copy link
Collaborator

Motivation

We are going to save the enabled/disabled networks in the backend, in the user profile. So, we need to load the user profile before all the other services, to avoid doing work for disabled networks.

Changes

  • Add loadUserProfile in the onMount of Loader component, before the addresses.

Tests

No changes in local replica.

@AntonioVentilii AntonioVentilii marked this pull request as ready for review March 27, 2025 20:04
@AntonioVentilii AntonioVentilii requested a review from a team as a code owner March 27, 2025 20:04
// So we need to load it first to enable/disable the rest of the services.
const { success: userProfileSuccess } = await loadUserProfile({ identity: $authIdentity });

if (!userProfileSuccess) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We better make this endpoint bulletproof :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe it's worth adding some retry mechanism here? Not in this PR

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, makes sense! Will work on it in another PR (inside service loadUserProfile)

Copy link
Contributor

@DenysKarmazynDFINITY DenysKarmazynDFINITY left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

@AntonioVentilii AntonioVentilii enabled auto-merge (squash) March 28, 2025 19:06
@AntonioVentilii AntonioVentilii merged commit adac166 into main Mar 28, 2025
25 checks passed
@AntonioVentilii AntonioVentilii deleted the feat(frontend)/load-user-profile-during-login branch March 28, 2025 19:09
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.

2 participants