Skip to content

Commit

Permalink
Fixed navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
FrayxRulez committed Jun 28, 2017
1 parent 89f026c commit 57e9c54
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions Unigram/Unigram/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
using Telegram.Api.Aggregator;
using Unigram.Controls;
using Unigram.Views.Users;
using System.Linq;

namespace Unigram
{
Expand Down Expand Up @@ -264,29 +265,36 @@ public override async Task OnStartAsync(StartKind startKind, IActivatedEventArgs
if (store != null && annotationStore != null)
{
var full = await store.GetContactAsync(contact.Contact.Id);
if (full == null)
{
goto Navigate;
}

var annotations = await annotationStore.FindAnnotationsForContactAsync(full);

var first = annotations.FirstOrDefault();
if (first != null)
if (first == null)
{
var remote = first.RemoteId;
if (int.TryParse(remote.Substring(1), out int userId))
{
NavigationService.Navigate(typeof(DialogPage), new TLPeerUser { UserId = userId });
}
else
{
NavigationService.Navigate(typeof(MainPage));
}
goto Navigate;
}

var remote = first.RemoteId;
if (int.TryParse(remote.Substring(1), out int userId))
{
NavigationService.Navigate(typeof(DialogPage), new TLPeerUser { UserId = userId });
}
else
{
NavigationService.Navigate(typeof(MainPage));
goto Navigate;
}
}
else
{
NavigationService.Navigate(typeof(MainPage));
}

Navigate:
NavigationService.Navigate(typeof(MainPage));
}
else if (args is ProtocolActivatedEventArgs protocol)
{
Expand Down

0 comments on commit 57e9c54

Please sign in to comment.