commit b468f26ec193c9a8b1045e626358810dddee8d5b
parent 3fc5e55c76888ed0a85a7997a6414e02b660b490
Author: triesap <tyson@radroots.org>
Date: Sun, 19 Apr 2026 01:32:26 +0000
window: open farm setup form directly from home
Diffstat:
1 file changed, 19 insertions(+), 14 deletions(-)
diff --git a/crates/launchers/desktop/src/window.rs b/crates/launchers/desktop/src/window.rs
@@ -604,17 +604,16 @@ impl HomeView {
fn open_farm_setup(&mut self, window: &mut Window, cx: &mut Context<Self>) {
let runtime_summary = self.runtime.summary();
+ let Some(account_id) = runtime_summary
+ .settings_account_projection
+ .selected_account
+ .as_ref()
+ .map(|account| account.account.account_id.clone())
+ else {
+ return;
+ };
if runtime_summary.farm_setup_projection.has_saved_farm() {
- let Some(account_id) = runtime_summary
- .settings_account_projection
- .selected_account
- .as_ref()
- .map(|account| account.account.account_id.clone())
- else {
- return;
- };
-
self.farm_setup_form = Some(FarmSetupFormState::new(
account_id,
runtime_summary.farm_setup_projection.draft,
@@ -625,10 +624,17 @@ impl HomeView {
return;
}
- if self
+ let stage_changed = self
.runtime
- .select_farm_setup_flow_stage(FarmSetupFlowStage::Editing)
- {
+ .select_farm_setup_flow_stage(FarmSetupFlowStage::Editing);
+
+ self.farm_setup_form = Some(FarmSetupFormState::new(
+ account_id,
+ runtime_summary.farm_setup_projection.draft,
+ window,
+ cx,
+ ));
+ if stage_changed || self.farm_setup_form.is_some() {
cx.notify();
}
}
@@ -649,8 +655,7 @@ impl HomeView {
return;
};
- if runtime_summary.home_route != HomeRoute::FarmSetupForm && self.farm_setup_form.is_none()
- {
+ if runtime_summary.home_route != HomeRoute::FarmSetupForm {
self.farm_setup_form = None;
return;
}