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

Commit cfd8573

Browse files
committed
Readme will now update if ETag changed. It will also use the MarkdownService over the network
1 parent 1d64b3c commit cfd8573

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

CodeHub.Core/ViewModels/Repositories/ReadmeViewModel.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,14 @@ public ICommand ShareCommand
4848
}
4949
}
5050

51-
protected override async Task Load(bool forceCacheInvalidation)
51+
protected override Task Load(bool forceCacheInvalidation)
5252
{
53-
var wiki = await this.GetApplication().Client.ExecuteAsync(this.GetApplication().Client.Users[Username].Repositories[Repository].GetReadme());
54-
_contentModel = wiki.Data;
55-
var d = Encoding.UTF8.GetString(Convert.FromBase64String(wiki.Data.Content));
56-
Data = await this.GetApplication().Client.Markdown.GetMarkdown(d);
57-
Path = CreateHtmlFile(Data);
53+
return this.RequestModel(this.GetApplication().Client.Users[Username].Repositories[Repository].GetReadme(), forceCacheInvalidation, x =>
54+
{
55+
var markdownService = GetService<IMarkdownService>();
56+
var data = markdownService.Convert(Encoding.UTF8.GetString(Convert.FromBase64String(x.Data.Content)));
57+
Path = CreateHtmlFile(data);
58+
});
5859
}
5960

6061
private string CreateHtmlFile(string data)

CodeHub.iOS/CodeHub.iOS.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ Global
344344
$2.inheritsScope = text/plain
345345
$0.TextStylePolicy = $3
346346
$3.FileWidth = 120
347+
$3.EolMarker = Windows
347348
$3.inheritsSet = VisualStudio
348349
$3.inheritsScope = text/plain
349350
$3.scope = text/x-csharp

0 commit comments

Comments
 (0)