aboutsummaryrefslogtreecommitdiff
path: root/Map/MapApp.swift
diff options
context:
space:
mode:
authorRuben Beltran del Rio <git@r.bdr.sh>2025-07-08 09:39:45 +0200
committerRuben Beltran del Rio <git@r.bdr.sh>2025-07-08 09:39:45 +0200
commit96a65922a562c59b792704dfae62119f4bf1560f (patch)
treee1858cd7ff0241c0b08b25a27d0b5e7ca3bd45a0 /Map/MapApp.swift
parent0c28a09091075ebfb0003efe2cfc32e1cc163d75 (diff)
Remove LazyMapEditor
Diffstat (limited to 'Map/MapApp.swift')
-rw-r--r--Map/MapApp.swift25
1 files changed, 2 insertions, 23 deletions
diff --git a/Map/MapApp.swift b/Map/MapApp.swift
index 5061807..78b0423 100644
--- a/Map/MapApp.swift
+++ b/Map/MapApp.swift
@@ -24,7 +24,7 @@ struct MapApp: App {
var body: some Scene {
DocumentGroup(newDocument: MapDocument(text: nil)) { file in
- LazyMapEditor(document: file.$document, url: file.fileURL)
+ MapEditor(document: file.$document, url: file.fileURL)
.focusedSceneValue(\.document, file.$document)
.focusedSceneValue(\.fileURL, file.fileURL)
}
@@ -62,7 +62,7 @@ struct LazyMapEditor: View {
}
var body: some View {
- if isActiveDocument && shouldRender {
+ if isActiveDocument {
MapEditor(document: $document, url: url)
} else {
Rectangle()
@@ -79,27 +79,6 @@ struct LazyMapEditor: View {
}
}
)
- .onChange(of: isActiveDocument) { _, newValue in
- renderTask?.cancel()
- renderTask = nil
-
- if newValue {
- renderTask = Task {
- try? await Task.sleep(nanoseconds: 50_000_000)
- if !Task.isCancelled {
- await MainActor.run {
- shouldRender = true
- }
- }
- }
- } else {
- shouldRender = false
- }
- }
- .onAppear {
- // Initialize focus state properly - don't render by default
- shouldRender = false
- }
}
}
}