Skip to content

Commit

Permalink
Comments: Fix placeholder while comments are loading
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimillian committed May 16, 2021
1 parent 1e1c274 commit 9b238f2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
4 changes: 2 additions & 2 deletions RedditOs.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 0.5.0;
MARKETING_VERSION = 0.5.1;
PRODUCT_BUNDLE_IDENTIFIER = com.thomasricouard.curiosity;
PRODUCT_NAME = Curiosity;
SWIFT_VERSION = 5.0;
Expand All @@ -680,7 +680,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 0.5.0;
MARKETING_VERSION = 0.5.1;
PRODUCT_BUNDLE_IDENTIFIER = com.thomasricouard.curiosity;
PRODUCT_NAME = Curiosity;
SWIFT_VERSION = 5.0;
Expand Down
17 changes: 14 additions & 3 deletions RedditOs/Features/Comments/CommentRow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ struct CommentRow: View {
@StateObject private var viewModel: CommentViewModel
@State private var showUserPopover = false

var isFake: Bool {
viewModel.comment.name == "t1_id"
}

init(comment: Comment) {
_viewModel = StateObject(wrappedValue: CommentViewModel(comment: comment))
}
Expand Down Expand Up @@ -69,9 +73,16 @@ struct CommentRow: View {
}
}
if let body = viewModel.comment.body {
Markdown(Document(body))
.font(.body)
.fixedSize(horizontal: false, vertical: true)
if isFake {
Text(body)
.font(.body)
.fixedSize(horizontal: false, vertical: true)
} else {
Markdown(Document(body))
.font(.body)
.fixedSize(horizontal: false, vertical: true)
}

} else {
Text("Deleted comment")
.font(.footnote)
Expand Down

0 comments on commit 9b238f2

Please sign in to comment.