Skip to content

Commit

Permalink
Fix build on tvOS
Browse files Browse the repository at this point in the history
  • Loading branch information
kean committed Feb 7, 2023
1 parent 3628412 commit 3cec23e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ struct NetworkDetailsView: View {

@ViewBuilder
private var contents: some View {
if let viewModel = viewModel?.text, viewModel.originalText.length > 0 {
if let viewModel = viewModel?.text, !viewModel.isEmpty {
RichTextView(viewModel: viewModel)
} else {
PlaceholderView(imageName: "nosign", title: "Empty")
Expand Down
2 changes: 2 additions & 0 deletions Sources/PulseUI/Views/RichTextView/RichTextViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ final class RichTextViewModel: ObservableObject {

var onLinkTapped: ((URL) -> Bool)?

var isEmpty: Bool { originalText.length == 0 }

weak var textView: UXTextView? // Not proper MVVM
var textStorage: NSTextStorage { textView?.textStorage ?? NSTextStorage(string: "") }

Expand Down

0 comments on commit 3cec23e

Please sign in to comment.