Skip to content

Commit c90df49

Browse files
authored
Merge pull request #34 from ohaiibuzzle/fix/previews-crashes
fix: Previews somehow crashes a production app (thank you Apple)
2 parents b80889d + c4ab2d5 commit c90df49

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

Harbor/Views/BottleManagementView.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ struct BottleManagementView: View {
3232
}
3333
}
3434

35-
#Preview {
36-
BottleManagementView(menuUIStates: MenuUIStates())
35+
struct BottleManagementView_Previews: PreviewProvider {
36+
static var previews: some View {
37+
BottleManagementView(menuUIStates: MenuUIStates())
38+
.environment(\.brewUtils, .init())
39+
}
3740
}

Harbor/Views/SetupView.swift

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ struct SetupView: View {
3535
.font(.title)
3636
Text("setup.saferSetup.subtitle")
3737
.multilineTextAlignment(.center)
38-
3938
Group {
4039
Button {
4140
isXcliInstallerDropdownShown.toggle()
@@ -57,7 +56,8 @@ struct SetupView: View {
5756
.frame(minWidth: 150)
5857
}
5958
.disabled(!brewUtils.installed)
60-
} }
59+
}
60+
}
6161
.padding()
6262
Spacer()
6363
VStack {
@@ -108,8 +108,10 @@ struct SetupView: View {
108108
}
109109
}
110110

111-
#Preview {
112-
SetupView()
113-
.environment(\.brewUtils, .init())
114-
.environment(\.xcliUtils, .init())
111+
struct SetupView_Previews: PreviewProvider {
112+
static var previews: some View {
113+
SetupView()
114+
.environment(\.brewUtils, .init())
115+
.environment(\.xcliUtils, .init())
116+
}
115117
}

0 commit comments

Comments
 (0)