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

Commit 24bf6e3

Browse files
committed
2.3.2-RC1
1 parent 8fb8830 commit 24bf6e3

4 files changed

Lines changed: 40 additions & 8 deletions

File tree

CodeHub.Core/ViewModels/PullRequests/PullRequestViewModel.cs

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -282,13 +282,20 @@ protected override Task Load(bool forceCacheInvalidation)
282282
}
283283

284284
public async Task Merge()
285-
{
286-
var response = await this.GetApplication().Client.ExecuteAsync(this.GetApplication().Client.Users[Username].Repositories[Repository].PullRequests[Id].Merge());
287-
if (!response.Data.Merged)
288-
throw new Exception(response.Data.Message);
285+
{
286+
try
287+
{
288+
var response = await this.GetApplication().Client.ExecuteAsync(this.GetApplication().Client.Users[Username].Repositories[Repository].PullRequests[Id].Merge());
289+
if (!response.Data.Merged)
290+
throw new Exception(response.Data.Message);
289291

290-
var pullRequest = this.GetApplication().Client.Users[Username].Repositories[Repository].PullRequests[Id].Get();
291-
await this.RequestModel(pullRequest, true, r => PullRequest = r.Data);
292+
var pullRequest = this.GetApplication().Client.Users[Username].Repositories[Repository].PullRequests[Id].Get();
293+
await this.RequestModel(pullRequest, true, r => PullRequest = r.Data);
294+
}
295+
catch (Exception e)
296+
{
297+
this.AlertService.Alert("Unable to Merge!", e.Message);
298+
}
292299
}
293300

294301
public ICommand MergeCommand

CodeHub.iOS/AppDelegate.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
using System.Linq;
2121
using System.Text;
2222
using CodeFramework.iOS.XCallback;
23+
using MonoTouch.Security;
2324

2425
namespace CodeHub.iOS
2526
{
@@ -90,6 +91,30 @@ public override bool FinishedLaunching(UIApplication app, NSDictionary options)
9091

9192
this.window.MakeKeyAndVisible();
9293

94+
// Record the date this application was installed (or the date that we started recording installation date).
95+
try
96+
{
97+
var query = new SecRecord(SecKind.GenericPassword) { Generic = NSData.FromString("codehub_install_date") };
98+
SecStatusCode secStatusCode;
99+
var rec = SecKeyChain.QueryAsRecord(query, out secStatusCode);
100+
if (secStatusCode != SecStatusCode.Success)
101+
{
102+
var newRec = new SecRecord(SecKind.GenericPassword)
103+
{
104+
Label = "CodeHub Install Date",
105+
Description = "The first date CodeHub was installed",
106+
ValueData = NSData.FromString(DateTime.UtcNow.ToString()),
107+
Generic = NSData.FromString("codehub_install_date")
108+
};
109+
110+
SecKeyChain.Add(newRec);
111+
}
112+
}
113+
catch
114+
{
115+
// Do nothing...
116+
}
117+
93118
InAppPurchases.Instance.PurchaseError += HandlePurchaseError;
94119
InAppPurchases.Instance.PurchaseSuccess += HandlePurchaseSuccess;
95120

lib/CodeFramework

lib/GitHubSharp

0 commit comments

Comments
 (0)