Fix crash
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user