Skip to content

Commit

Permalink
wizard: fix VHDX checkbox on older OS
Browse files Browse the repository at this point in the history
Fixes #3760
  • Loading branch information
osy committed Mar 14, 2022
1 parent 14e4b41 commit de78459
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions Platform/Shared/VMWizardOSWindowsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,15 @@ struct VMWizardOSWindowsView: View {
Text("Image File Type")
}
.onAppear {
if wizardState.windowsBootVhdx != nil {
useVhdx = true
} else {
#if arch(arm64)
useVhdx = wizardState.useVirtualization
#endif
// SwiftUI bug: on macOS 11, onAppear() is called every time the check box is clicked
if #available(iOS 15, macOS 12, *) {
if wizardState.windowsBootVhdx != nil {
useVhdx = true
} else {
#if arch(arm64)
useVhdx = wizardState.useVirtualization
#endif
}
}
}

Expand Down

0 comments on commit de78459

Please sign in to comment.