]> git.proxmox.com Git - pve-installer.git/commitdiff
tui: refresh summary view if it is switched back to
authorChristoph Heiss <c.heiss@proxmox.com>
Wed, 21 Jun 2023 10:09:24 +0000 (12:09 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 21 Jun 2023 10:20:41 +0000 (12:20 +0200)
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
proxmox-tui-installer/src/main.rs

index 789dbefce0ecf7d0130459e0b26b6cb2088e9d3e..ae979d9f42d097c3f0e7fe82eb13e49cfaa832cd 100644 (file)
@@ -283,6 +283,17 @@ fn switch_to_next_screen(
     // Check if the screen already exists; if yes, then simply switch to it.
     if let Some(screen_id) = state.steps.get(&step) {
         siv.set_screen(*screen_id);
+
+        // The summary view cannot be cached (otherwise it would display stale values). Thus
+        // replace it if the screen is switched to.
+        // TODO: Could be done by e.g. having all the main dialog views implement some sort of
+        // .refresh(), which can be called if the view is switched to.
+        if step == InstallerStep::Summary {
+            let view = constructor(siv);
+            siv.screen_mut().pop_layer();
+            siv.screen_mut().add_layer(view);
+        }
+
         return;
     }