@@ -104,13 +104,15 @@ def check_bootloader_unlocked(e):
104104 self .state .steps = (
105105 self .state .config .flash_recovery + self .state .config .install_os
106106 )
107+ self .state .num_total_steps = len (self .state .steps )
107108 else :
108109 logger .info ("Enabled unlocking the bootloader again." )
109110 self .state .steps = (
110111 self .state .config .unlock_bootloader
111112 + self .state .config .flash_recovery
112113 + self .state .config .install_os
113114 )
115+ self .state .num_total_steps = len (self .state .steps )
114116
115117 self .bootloader_checkbox = Checkbox (
116118 label = "Bootlaoder is already unlocked." , on_change = check_bootloader_unlocked
@@ -413,7 +415,7 @@ def confirm(self, e):
413415 # if a config is loaded, display a progress bar
414416 if self .config :
415417 self .progress_bar .value = (self .num_steps - 1 ) / (
416- self .num_total_steps + 2
418+ self .state . num_total_steps + 2
417419 ) # don't show on the first step
418420 self .num_steps += 1 # increase the step counter
419421 # if there are default views left, display them first
@@ -445,7 +447,7 @@ def load_config(self, device_code: str) -> Optional[str]:
445447 + self .config .flash_recovery
446448 + self .config .install_os
447449 )
448- self .num_total_steps = len (self .state .steps )
450+ self .state . num_total_steps = len (self .state .steps )
449451 return self .config .metadata .get ("devicename" , "No device name in config." )
450452
451453 def pick_image_result (self , e : FilePickerResultEvent ):
0 commit comments