Skip to content

Commit

Permalink
only show cta after we have an updated list
Browse files Browse the repository at this point in the history
  • Loading branch information
futurepaul committed Nov 25, 2024
1 parent 50f3355 commit 796e2d6
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions harbor-ui/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ pub struct HarborWallet {
add_federation_status: AddFederationStatus,
// Onboarding
show_add_a_mint_cta: bool,
has_navigated_to_mints: bool,
}

impl HarborWallet {
Expand Down Expand Up @@ -350,6 +351,7 @@ impl HarborWallet {
Route::Mints(_) => {
// Hide the add a mint cta when navigating to mints
self.show_add_a_mint_cta = false;
self.has_navigated_to_mints = true;
self.active_route = route;
}
_ => self.active_route = route,
Expand Down Expand Up @@ -772,6 +774,15 @@ impl HarborWallet {
self.active_federation = list.first().cloned();
}

// Hide the CTA if we have any federations
if !list.is_empty() {
self.show_add_a_mint_cta = false;
}

if !self.has_navigated_to_mints && list.is_empty() {
self.show_add_a_mint_cta = true;
}

self.federation_list = list;
Task::none()
}
Expand Down Expand Up @@ -820,9 +831,6 @@ impl HarborWallet {
CoreUIMsg::UnlockSuccess => {
self.unlock_status = UnlockStatus::Unlocked;
self.active_route = Route::Home;
if self.federation_list.is_empty() {
self.show_add_a_mint_cta = true;
}
Task::none()
}
CoreUIMsg::UnlockFailed(reason) => {
Expand Down

0 comments on commit 796e2d6

Please sign in to comment.