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

Commit 5b72de2

Browse files
committed
Resolved Regression, Memory leak, and pull request merge button
Fixes #144
1 parent 70a337a commit 5b72de2

30 files changed

Lines changed: 355 additions & 246 deletions

CodeHub.Core/CodeHub.Core.iOS.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,15 +225,15 @@
225225
<Reference Include="Newtonsoft.Json">
226226
<HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\portable-net40+sl5+wp80+win8+wpa81\Newtonsoft.Json.dll</HintPath>
227227
</Reference>
228-
<Reference Include="GitHubSharp">
229-
<HintPath>..\packages\GitHubClient.1.0.5.0\lib\portable-net45+win+wpa81\GitHubSharp.dll</HintPath>
230-
</Reference>
231228
<Reference Include="Cirrious.MvvmCross.Touch">
232229
<HintPath>..\packages\MvvmCross.HotTuna.MvvmCrossLibraries.3.5.1\lib\Xamarin.iOS10\Cirrious.MvvmCross.Touch.dll</HintPath>
233230
</Reference>
234231
<Reference Include="Cirrious.MvvmCross">
235232
<HintPath>..\packages\MvvmCross.HotTuna.MvvmCrossLibraries.3.5.1\lib\Xamarin.iOS10\Cirrious.MvvmCross.dll</HintPath>
236233
</Reference>
234+
<Reference Include="GitHubSharp">
235+
<HintPath>..\packages\GitHubClient.1.0.6.0\lib\portable-net45+win+wpa81\GitHubSharp.dll</HintPath>
236+
</Reference>
237237
</ItemGroup>
238238
<ItemGroup />
239239
<ItemGroup>

CodeHub.Core/ViewModels/LoadableViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public abstract class LoadableViewModel : BaseViewModel
1313
private readonly ICommand _loadCommand;
1414
private bool _isLoading;
1515

16-
public ICommand LoadCommand
16+
public ICommand LoadCommand
1717
{
1818
get { return _loadCommand; }
1919
}

CodeHub.Core/ViewModels/PullRequests/PullRequestViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ public async Task Merge()
285285
{
286286
try
287287
{
288-
var response = await this.GetApplication().Client.ExecuteAsync(this.GetApplication().Client.Users[Username].Repositories[Repository].PullRequests[Id].Merge());
288+
var response = await this.GetApplication().Client.ExecuteAsync(this.GetApplication().Client.Users[Username].Repositories[Repository].PullRequests[Id].Merge(string.Empty));
289289
if (!response.Data.Merged)
290290
throw new Exception(response.Data.Message);
291291

CodeHub.Core/ViewModels/Source/BranchesAndTagsViewModel.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using System.Windows.Input;
33
using Cirrious.MvvmCross.ViewModels;
44
using CodeFramework.Core.ViewModels;
5-
using CodeHub.Core.Services;
65
using GitHubSharp.Models;
76
using System.Linq;
87

CodeHub.Core/ViewModels/Source/EditSourceViewModel.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
using System;
2-
using CodeFramework.Core.ViewModels;
32
using System.Threading.Tasks;
43
using CodeHub.Core.Messages;
5-
using Cirrious.MvvmCross.ViewModels;
6-
using System.Windows.Input;
74

85
namespace CodeHub.Core.ViewModels.Source
96
{

CodeHub.Core/ViewModels/Source/SourceViewModel.cs

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System.Threading.Tasks;
22
using System.Windows.Input;
33
using Cirrious.MvvmCross.ViewModels;
4-
using GitHubSharp.Models;
54
using System;
65
using CodeFramework.Core.ViewModels;
76
using Cirrious.MvvmCross.Plugins.Messenger;
@@ -11,7 +10,7 @@ namespace CodeHub.Core.ViewModels.Source
1110
{
1211
public class SourceViewModel : FileSourceViewModel
1312
{
14-
private MvxSubscriptionToken _editToken;
13+
private readonly MvxSubscriptionToken _editToken;
1514

1615
private string _path;
1716
private string _name;
@@ -54,6 +53,18 @@ public ICommand GoToEditCommand
5453
get { return new MvxCommand(() => ShowViewModel<EditSourceViewModel>(new EditSourceViewModel.NavObject { Path = _path, Branch = Branch, Username = Username, Repository = Repository }), () => ContentPath != null && TrueBranch); }
5554
}
5655

56+
public SourceViewModel()
57+
{
58+
_editToken = Messenger.SubscribeOnMainThread<SourceEditMessage>(x =>
59+
{
60+
if (x.OldSha == null || x.Update == null)
61+
return;
62+
_gitUrl = x.Update.Content.GitUrl;
63+
if (LoadCommand.CanExecute(null))
64+
LoadCommand.Execute(true);
65+
});
66+
}
67+
5768
public void Init(NavObject navObject)
5869
{
5970
_path = navObject.Path;
@@ -73,14 +84,6 @@ public void Init(NavObject navObject)
7384

7485
//Create the temp file path
7586
Title = fileName;
76-
77-
_editToken = Messenger.SubscribeOnMainThread<SourceEditMessage>(x =>
78-
{
79-
if (x.OldSha == null || x.Update == null)
80-
return;
81-
_gitUrl = x.Update.Content.GitUrl;
82-
LoadCommand.Execute(true);
83-
});
8487
}
8588

8689
public class NavObject

CodeHub.Core/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<packages>
33
<package id="Flurry.Analytics" version="1.2.1" targetFramework="xamarinios10" />
44
<package id="Flurry.Analytics.Portable" version="1.2.0" targetFramework="xamarinios10" />
5-
<package id="GitHubClient" version="1.0.5.0" targetFramework="xamarinios10" />
5+
<package id="GitHubClient" version="1.0.6.0" targetFramework="xamarinios10" />
66
<package id="modernhttpclient" version="2.4.2" targetFramework="xamarinios10" />
77
<package id="MvvmCross" version="3.5.1" targetFramework="xamarinios10" />
88
<package id="MvvmCross.HotTuna.CrossCore" version="3.5.1" targetFramework="xamarinios10" />

CodeHub.iOS/CodeHub.iOS.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@
2929
<MtouchArch>i386</MtouchArch>
3030
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
3131
<CodesignKey>iPhone Developer</CodesignKey>
32-
<MtouchSdkVersion>8.0</MtouchSdkVersion>
3332
<MtouchUseRefCounting>true</MtouchUseRefCounting>
33+
<MtouchProfiling>true</MtouchProfiling>
34+
<MtouchUseSGen>true</MtouchUseSGen>
3435
</PropertyGroup>
3536
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
3637
<DebugType>none</DebugType>
@@ -217,7 +218,6 @@
217218
<Compile Include="Views\Gists\GistCreateView.cs" />
218219
<None Include="Entitlements.plist" />
219220
<Compile Include="Views\Repositories\RepositoriesTrendingView.cs" />
220-
<None Include="RELEASE-NOTES.txt" />
221221
<Compile Include="ViewControllers\MarkdownComposerViewController.cs" />
222222
<Compile Include="Views\App\SidebarOrderView.cs" />
223223
<Compile Include="Views\App\EnablePushNotificationsViewController.cs" />
@@ -413,17 +413,17 @@
413413
<Reference Include="Newtonsoft.Json">
414414
<HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\portable-net40+sl5+wp80+win8+wpa81\Newtonsoft.Json.dll</HintPath>
415415
</Reference>
416-
<Reference Include="GitHubSharp">
417-
<HintPath>..\packages\GitHubClient.1.0.5.0\lib\portable-net45+win+wpa81\GitHubSharp.dll</HintPath>
418-
</Reference>
419416
<Reference Include="BTProgressHUD">
420417
<HintPath>..\packages\BTProgressHUD.1.0.0\lib\Xamarin.iOS10\BTProgressHUD.dll</HintPath>
421418
</Reference>
422419
<Reference Include="Cirrious.MvvmCross.Plugins.Messenger">
423420
<HintPath>..\packages\MvvmCross.HotTuna.Plugin.Messenger.3.5.1\lib\Xamarin.iOS10\Cirrious.MvvmCross.Plugins.Messenger.dll</HintPath>
424421
</Reference>
422+
<Reference Include="GitHubSharp">
423+
<HintPath>..\packages\GitHubClient.1.0.6.0\lib\portable-net45+win+wpa81\GitHubSharp.dll</HintPath>
424+
</Reference>
425425
<Reference Include="MonoTouch.Slideout">
426-
<HintPath>..\packages\MonoTouch.SlideoutNavigation.0.1.1\lib\Xamarin.iOS10\MonoTouch.Slideout.dll</HintPath>
426+
<HintPath>..\packages\MonoTouch.SlideoutNavigation.1.0.1\lib\Xamarin.iOS10\MonoTouch.Slideout.dll</HintPath>
427427
</Reference>
428428
</ItemGroup>
429429
<ItemGroup>

CodeHub.iOS/Info.plist

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<key>CFBundleIdentifier</key>
2222
<string>com.dillonbuchanan.codehub</string>
2323
<key>CFBundleShortVersionString</key>
24-
<string>2.3.7</string>
24+
<string>2.3.8</string>
2525
<key>CFBundleIconFiles</key>
2626
<array>
2727
<string>Icon-60@2x</string>
@@ -71,8 +71,13 @@
7171
<string>UIInterfaceOrientationLandscapeRight</string>
7272
</array>
7373
<key>CFBundleVersion</key>
74-
<string>2.3.7.1</string>
74+
<string>2.3.8.1</string>
7575
<key>UILaunchStoryboardName</key>
7676
<string>Launch</string>
77+
<key>NSAppTransportSecurity</key>
78+
<dict>
79+
<key>NSAllowsArbitraryLoads</key>
80+
<true/>
81+
</dict>
7782
</dict>
7883
</plist>

CodeHub.iOS/RELEASE-NOTES.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)