[yew-devel] [PATCH yew-comp v2 3/4] wizard: optimize enabled check for next button
Dominik Csapak
d.csapak at proxmox.com
Wed May 7 11:11:11 CEST 2025
by first checking for `self.loading` since we don't have to iterate
over the wizard pages if that is true.
Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
changes from v1:
* fix typo in commit subject
* use simpler boolean expression instead of if/else
src/wizard.rs | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/src/wizard.rs b/src/wizard.rs
index e33d3c6..7990cf4 100644
--- a/src/wizard.rs
+++ b/src/wizard.rs
@@ -635,11 +635,7 @@ impl PwtWizard {
Some(key) => props.pages.get_index_of(key).unwrap_or(0),
};
- let mut next_is_enabled = state.can_progress();
-
- if self.loading {
- next_is_enabled = false;
- }
+ let next_is_enabled = !self.loading && state.can_progress();
let next_page = props
.pages
--
2.39.5
More information about the yew-devel
mailing list