From 5a303b257d579ae6d366ddc1da6763269985a5f7 Mon Sep 17 00:00:00 2001 From: kean Date: Tue, 24 Jan 2023 00:25:11 -0500 Subject: [PATCH] Fix navigation on macOS --- .../PulseUI/Features/Console/Views/ConsoleEntityCell.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Sources/PulseUI/Features/Console/Views/ConsoleEntityCell.swift b/Sources/PulseUI/Features/Console/Views/ConsoleEntityCell.swift index 5a0bdef70..39eee1b37 100644 --- a/Sources/PulseUI/Features/Console/Views/ConsoleEntityCell.swift +++ b/Sources/PulseUI/Features/Console/Views/ConsoleEntityCell.swift @@ -49,7 +49,8 @@ private struct _ConsoleMessageCell: View { let cell = ConsoleMessageCell(viewModel: .init(message: message), isDisclosureNeeded: true) .background(NavigationLink("", destination: LazyConsoleDetailsView(message: message)).opacity(0)) #else - let cell = NavigationLink(destination: LazyConsoleDetailsView(message: message)) { + // `id` is a workaround for macOS (needs to be fixed) + let cell = NavigationLink(destination: LazyConsoleDetailsView(message: message).id(message.objectID)) { ConsoleMessageCell(viewModel: .init(message: message)) } #endif @@ -99,7 +100,7 @@ private struct _ConsoleTaskCell: View { let cell = ConsoleTaskCell(task: task, isDisclosureNeeded: true) .background(NavigationLink("", destination: LazyNetworkInspectorView(task: task).id(task.objectID)).opacity(0)) #else - let cell = NavigationLink(destination: LazyNetworkInspectorView(task: task)) { + let cell = NavigationLink(destination: LazyNetworkInspectorView(task: task).id(task.objectID)) { ConsoleTaskCell(task: task) } #endif