diff --git a/FoxTube.Core/Utils/Metrics.cs b/FoxTube.Core/Utils/Metrics.cs index 5e45219..7d45269 100644 --- a/FoxTube.Core/Utils/Metrics.cs +++ b/FoxTube.Core/Utils/Metrics.cs @@ -57,6 +57,7 @@ namespace FoxTube.Utils public static void SendReport(Exception exception, ErrorAttachmentLog[] logs = null, params (string key, string value)[] details) { + logs ??= new ErrorAttachmentLog[0]; Crashes.TrackError(exception, details.Length < 1 ? null : details.Select(i => new KeyValuePair(i.key, i.value)) as Dictionary, diff --git a/FoxTube/App.xaml.cs b/FoxTube/App.xaml.cs index 9ef7847..1ff2f5f 100644 --- a/FoxTube/App.xaml.cs +++ b/FoxTube/App.xaml.cs @@ -4,6 +4,7 @@ using FoxTube.Utils; using Windows.ApplicationModel; using Windows.ApplicationModel.Activation; using Windows.UI; +using Windows.UI.Popups; using Windows.UI.ViewManagement; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; @@ -20,14 +21,23 @@ namespace FoxTube UnhandledException += ErrorOccured; } - protected override async void OnLaunched(LaunchActivatedEventArgs e) + protected override async void OnLaunched(LaunchActivatedEventArgs args) { - await UserManagement.Initialize(); - await StoreInterop.UpdateStoreState(); - if (Settings.LastReviewedVersion != Metrics.CurrentVersion) - Inbox.PushChangelog(); + try + { + await UserManagement.Initialize(); + await StoreInterop.UpdateStoreState(); + if (Settings.LastReviewedVersion != Metrics.CurrentVersion) + Inbox.PushChangelog(); + } + catch (Exception e) + { + Metrics.SendReport(new Exception("OuLaunch initialization failed", e)); + await new MessageDialog("There can be a temporary server issue or weak internet connection. Please, check your internet connection and try again later", "Something went wrong...").ShowAsync(); + Utils.Utils.CloseApp(); + } - if (!e.PrelaunchActivated && Window.Current.Content == null) + if (!args.PrelaunchActivated && Window.Current.Content == null) Window.Current.Content = new MainPage(); Window.Current.Activate(); } diff --git a/FoxTube/Assets/Logo.png b/FoxTube/Assets/Logo.png new file mode 100644 index 0000000..0547a47 Binary files /dev/null and b/FoxTube/Assets/Logo.png differ diff --git a/FoxTube/FoxTube.csproj b/FoxTube/FoxTube.csproj index 1f6c0a5..74af58f 100644 --- a/FoxTube/FoxTube.csproj +++ b/FoxTube/FoxTube.csproj @@ -189,6 +189,7 @@ +