aboutsummaryrefslogtreecommitdiff
path: root/Map
diff options
context:
space:
mode:
Diffstat (limited to 'Map')
-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
- }
}
}
}