Skip to content

Commit 26e16af

Browse files
committed
Fix PulseUI build on macOS
1 parent 7a63dcb commit 26e16af

File tree

4 files changed

+12
-15
lines changed

4 files changed

+12
-15
lines changed

Sources/PulseUI/Features/FileViewer/RichTextView/RichTextView-watchos.swift

+5-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import SwiftUI
66
import Pulse
77

8-
#if os(watchOS) || os(tvOS)
8+
#if os(watchOS) || os(tvOS) || os(macOS)
99

1010
struct RichTextView: View {
1111
let viewModel: RichTextViewModel
@@ -41,7 +41,11 @@ final class RichTextViewModel: ObservableObject {
4141
}
4242

4343
init(string: NSAttributedString, contentType: NetworkLogger.ContentType? = nil) {
44+
#if os(macOS)
45+
self.attributedString = try? AttributedString(string, including: \.appKit)
46+
#else
4447
self.attributedString = try? AttributedString(string, including: \.uiKit)
48+
#endif
4549
self.text = string.string
4650
}
4751
}

Sources/PulseUI/Features/Inspector/NetworkDetailsView.swift

-11
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,3 @@ final class NetworkDetailsViewModel {
4848
self.makeString = closure
4949
}
5050
}
51-
52-
#if os(macOS)
53-
final class RichTextViewModel: ObservableObject {
54-
let isEmpty = true
55-
56-
init(string: String) {}
57-
init(string: NSAttributedString) {}
58-
init(string: NSAttributedString, contentType: NetworkLogger.ContentType?) {}
59-
60-
}
61-
#endif

Sources/PulseUI/Features/Search/Views/ConsoleSearchResultsSectionView.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ struct PlainListGroupSeparator: View {
116116

117117
#if os(iOS) || os(visionOS) || os(macOS)
118118

119-
@available(iOS 15, visionOS 1.0, *)
119+
@available(iOS 15, macOS 13, visionOS 1, *)
120120
struct PlainListSectionHeader<Content: View>: View {
121121
var title: String?
122122
@ViewBuilder let content: () -> Content
@@ -144,14 +144,14 @@ struct PlainListSectionHeader<Content: View>: View {
144144
}
145145
}
146146

147-
@available(iOS 15, visionOS 1.0, *)
147+
@available(iOS 15, macOS 13, visionOS 1, *)
148148
extension PlainListSectionHeader where Content == Text {
149149
init(title: String) {
150150
self.init(title: title, content: { Text(title) })
151151
}
152152
}
153153

154-
@available(iOS 15, visionOS 1.0, *)
154+
@available(iOS 15, visionOS 1, *)
155155
struct PlainListSeeAllView: View {
156156
let count: Int
157157

Sources/PulseUI/Helpers/Components.swift

+4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ struct Components {
2020

2121
@available(iOS 15, macOS 13, visionOS 1, *)
2222
static func makeConsoleEntityCell(entity: NSManagedObject) -> some View {
23+
#if os(macOS)
24+
EmptyView()
25+
#else
2326
ConsoleEntityCell(entity: entity)
27+
#endif
2428
}
2529

2630
static func makePinView(for task: NetworkTaskEntity) -> some View {

0 commit comments

Comments
 (0)