From 96a65922a562c59b792704dfae62119f4bf1560f Mon Sep 17 00:00:00 2001 From: Ruben Beltran del Rio Date: Tue, 8 Jul 2025 09:39:45 +0200 Subject: Remove LazyMapEditor --- Map/MapApp.swift | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) (limited to 'Map') 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 - } } } } -- cgit