Skip to content
This repository was archived by the owner on Jul 2, 2022. It is now read-only.

Commit 9364c7e

Browse files
committed
Fixed issue where comments didnt load correctly
1 parent 7048af1 commit 9364c7e

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

CodeHub.iOS/Views/Issues/IssueView.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,17 @@ public void RenderComments()
6868
var s = Cirrious.CrossCore.Mvx.Resolve<CodeFramework.Core.Services.IJsonSerializationService>();
6969
var data = s.Serialize(comments);
7070
InvokeOnMainThread(() => {
71-
if (_commentsElement.GetImmediateRootElement() == null)
72-
Root.Insert(Root.Count - 1, new Section() { _commentsElement });
7371
_commentsElement.Value = data;
72+
if (_commentsElement.GetImmediateRootElement() == null)
73+
RenderIssue();
7474
});
7575
}
7676

7777
public void RenderIssue()
78-
{
78+
{
79+
if (ViewModel.Issue == null)
80+
return;
81+
7982
NavigationItem.RightBarButtonItem.Enabled = true;
8083

8184
var root = new RootElement(Title);
@@ -112,7 +115,7 @@ public void RenderIssue()
112115
secDetails.Add(responsible);
113116
root.Add(secDetails);
114117

115-
if (ViewModel.Issue.Comments > 0)
118+
if (ViewModel.Comments.Any())
116119
{
117120
root.Add(new Section { _commentsElement });
118121
}

0 commit comments

Comments
 (0)