mirror of
https://github.com/rbalsleyMSFT/FFU.git
synced 2026-06-14 02:09:35 -06:00
Clears existing items in cmbMake dropdown during UI initialization to prevent duplication on re-initialization. Ensures a fresh list of manufacturers is displayed each time defaults are restored.
This commit is contained in:
@@ -322,12 +322,16 @@ function Initialize-UIDefaults {
|
|||||||
|
|
||||||
# Drivers tab UI logic
|
# Drivers tab UI logic
|
||||||
$makeList = @('Microsoft', 'Dell', 'HP', 'Lenovo')
|
$makeList = @('Microsoft', 'Dell', 'HP', 'Lenovo')
|
||||||
|
if ($null -ne $State.Controls.cmbMake) {
|
||||||
|
# Clear existing items to prevent duplication on re-initialization (e.g., after Restore Defaults)
|
||||||
|
$State.Controls.cmbMake.Items.Clear()
|
||||||
foreach ($m in $makeList) {
|
foreach ($m in $makeList) {
|
||||||
[void]$State.Controls.cmbMake.Items.Add($m)
|
[void]$State.Controls.cmbMake.Items.Add($m)
|
||||||
}
|
}
|
||||||
if ($State.Controls.cmbMake.Items.Count -gt 0) {
|
if ($State.Controls.cmbMake.Items.Count -gt 0) {
|
||||||
$State.Controls.cmbMake.SelectedIndex = 0
|
$State.Controls.cmbMake.SelectedIndex = 0
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Update-DriverDownloadPanelVisibility -State $State
|
Update-DriverDownloadPanelVisibility -State $State
|
||||||
|
|
||||||
# Set initial state for driver checkbox interplay
|
# Set initial state for driver checkbox interplay
|
||||||
|
|||||||
Reference in New Issue
Block a user