Fix crash
This commit is contained in:
parent
42f625b94f
commit
b767301aa0
@ -245,7 +245,7 @@ struct ContentView: View {
|
||||
SettingsView(isPresented: $showSettingsSheet)
|
||||
}
|
||||
.sheet(isPresented: $showGridView) {
|
||||
GridView(isPresented: $showGridView)
|
||||
GridView(isPresented: $showGridView, database: database)
|
||||
}.alert(isPresented: $showNewClassifierAlert) {
|
||||
Alert(title: Text("New classifier available"),
|
||||
message: Text("Classifier \(database.serverClassifierVersion) is available. You have version \(database.classifierVersion). Do you want to download it now?"),
|
||||
|
@ -3,8 +3,7 @@ import SFSafeSymbols
|
||||
|
||||
struct GridView: View {
|
||||
|
||||
@EnvironmentObject
|
||||
var database: Database
|
||||
let database: Database
|
||||
|
||||
|
||||
@AppStorage("currentGridName")
|
||||
@ -36,8 +35,9 @@ struct GridView: View {
|
||||
|
||||
@State var lastScaleValue: CGFloat = 1.0
|
||||
|
||||
init(isPresented: Binding<Bool>) {
|
||||
init(isPresented: Binding<Bool>, database: Database) {
|
||||
self._isPresented = isPresented
|
||||
self.database = database
|
||||
self.image = .init(columns: 1, capPlacements: [])
|
||||
|
||||
if let image = database.load(grid: currentGridName) {
|
||||
@ -165,7 +165,6 @@ struct GridView: View {
|
||||
|
||||
struct GridView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
GridView(isPresented: .constant(true))
|
||||
.environmentObject(Database.largeMock)
|
||||
GridView(isPresented: .constant(true), database: .largeMock)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user