]> git.r.bdr.sh - rbdr/map/blobdiff - Map/Views/ContentView.swift
Fix performance and undo
[rbdr/map] / Map / Views / ContentView.swift
index f439026249988f669b78b118f7d9b4116db2ed10..534c14c41761453e6666776ae58100d51943b9ef 100644 (file)
@@ -25,7 +25,9 @@ struct ContentView: View {
           DefaultMapView()
         }
         ForEach(maps) { map in
-          NavigationLink(destination: MapDetailView(map: map)) {
+          NavigationLink(
+            destination: MapDetailView(map: map, title: map.title ?? "", content: map.content ?? "")
+          ) {
             HStack {
               Text(map.title ?? "Untitled Map")
               Spacer()
@@ -38,10 +40,12 @@ struct ContentView: View {
                 .cornerRadius(2.0)
             }.padding(.leading, 8.0)
           }.contextMenu {
-            Button(action: { store.send(.deleteMap(map: map))}) {
-              Image(systemName: "trash")
-              Text("Delete")
-            }
+            Button(
+              action: { store.send(.deleteMap(map: map)) },
+              label: {
+                Image(systemName: "trash")
+                Text("Delete")
+              })
           }
         }
         .onDelete(perform: deleteMaps)
@@ -56,7 +60,7 @@ struct ContentView: View {
             }
           }
         }
-        DefaultMapView()
+      DefaultMapView()
     }
   }