diff --git a/FoxTube/App.xaml.cs b/FoxTube/App.xaml.cs index 8188902..c90174a 100644 --- a/FoxTube/App.xaml.cs +++ b/FoxTube/App.xaml.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; @@ -72,8 +73,6 @@ namespace FoxTube /// Details about the launch request and process. protected override void OnLaunched(LaunchActivatedEventArgs e) { - SecretsVault.CheckAuthorization(); - Frame rootFrame = Window.Current.Content as Frame; // Do not repeat app initialization when the Window already has content, @@ -110,6 +109,28 @@ namespace FoxTube CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = true; } + protected override void OnActivated(IActivatedEventArgs e) + { + base.OnActivated(e); + + if (e is ToastNotificationActivatedEventArgs) + { + string[] args = (e as ToastNotificationActivatedEventArgs).Argument.Split('|'); + switch (args[0]) + { + case "changelog": + case "inbox": + Methods.MainPage.GoToDeveloper(args[1]); + break; + + //TODO: The rest + } + } + + CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = true; + Window.Current.Activate(); + } + /// /// Invoked when Navigation to a certain page fails /// diff --git a/FoxTube/Pages/MainPage.xaml.cs b/FoxTube/Pages/MainPage.xaml.cs index bf745c8..c0485e1 100644 --- a/FoxTube/Pages/MainPage.xaml.cs +++ b/FoxTube/Pages/MainPage.xaml.cs @@ -74,7 +74,7 @@ namespace FoxTube if (settings.Values["ver"] == null) settings.Values.Add("ver", $"{ver.Major}.{ver.Minor}"); - if((string)settings.Values["ver"] != $"{ver.Major}.{ver.Minor}") //Replace for '!=' !!! + if((string)settings.Values["ver"] == $"{ver.Major}.{ver.Minor}") //Replace for '!=' !!! { try { @@ -91,6 +91,7 @@ namespace FoxTube SecretsVault.AuthorizationStateChanged += Vault_AuthorizationStateChanged; SecretsVault.SubscriptionsChanged += SecretsVault_SubscriptionsChanged; + SecretsVault.CheckAuthorization(); SetTitleBar(); }