Skip to content

Commit

Permalink
Added Insights and fixed extended party bug
Browse files Browse the repository at this point in the history
  • Loading branch information
navedmerchant committed Dec 16, 2016
1 parent 1ecdb2d commit 80e858a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
21 changes: 21 additions & 0 deletions Disa.Framework.Telegram.Mobile.Shared/Setup.cs
Expand Up @@ -12,6 +12,7 @@
using System.Text;
using System.Security.Cryptography;
using System.IO;
using Xamarin;

namespace Disa.Framework.Telegram.Mobile
{
Expand Down Expand Up @@ -42,6 +43,24 @@ public TelegramSetupSettings()
}
}

//Setup exception class for Xamarin Insights Exception
public class SetupException : Exception
{
public SetupException()
{
}

public SetupException(string message)
: base(message)
{
}

public SetupException(string message, Exception inner)
: base(message, inner)
{
}
}

private static Task<ActivationResult> Register(Service service, string nationalNumber, string countryCode, string code, string firstName = null, string lastName = null)
{
return Task<ActivationResult>.Factory.StartNew(() =>
Expand Down Expand Up @@ -185,6 +204,7 @@ private static void Save(Service service, uint accountId, TelegramSettings setti
}

Utils.DebugPrint("Starting the service...!");
Insights.Report(new SetupException("Telegram Setup Ended"));
ServiceManager.Start(service, true);
}
catch (Exception ex)
Expand Down Expand Up @@ -314,6 +334,7 @@ public static Page Fetch(Service service)

tabs.Title = Localize.GetString("TelegramSetupWizardTitle");
_cachedPage = tabs;
Insights.Report(new SetupException("Telegram Setup Started"));
return tabs;
}

Expand Down
5 changes: 4 additions & 1 deletion Disa.Framework.Telegram.Shared/Telegram.cs
Expand Up @@ -835,7 +835,10 @@ private List<VisualBubble> MakePartyInformationBubble(MessageService messageServ
var bubbleGroupToDelete = BubbleGroupManager.FindWithAddress(this, address);
if (bubbleGroupToSwitch != null)
{
Platform.SwitchCurrentBubbleGroupOnUI(bubbleGroupToSwitch);
if (Platform.GetCurrentBubbleGroupOnUI() == bubbleGroupToDelete)
{
Platform.SwitchCurrentBubbleGroupOnUI(bubbleGroupToSwitch);
}
}
if (bubbleGroupToDelete != null)
{
Expand Down

0 comments on commit 80e858a

Please sign in to comment.