From 7bcc2ed7d04d6da27d726725fc947e3d31901f36 Mon Sep 17 00:00:00 2001 From: Stepan Usatiuk Date: Sat, 6 Jun 2020 19:02:23 +0300 Subject: [PATCH] move some things around so they make more sense --- PomoTime/App.xaml.cs | 2 +- PomoTime/MainPage.xaml.cs | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/PomoTime/App.xaml.cs b/PomoTime/App.xaml.cs index c217f98..caa311f 100644 --- a/PomoTime/App.xaml.cs +++ b/PomoTime/App.xaml.cs @@ -83,7 +83,7 @@ namespace PomoTime // Ensure the current window is active Window.Current.Activate(); } - if (e is ToastNotificationActivatedEventArgs) + else if (e is ToastNotificationActivatedEventArgs) { var toastActivationArgs = e as ToastNotificationActivatedEventArgs; diff --git a/PomoTime/MainPage.xaml.cs b/PomoTime/MainPage.xaml.cs index 304610d..4921ff9 100644 --- a/PomoTime/MainPage.xaml.cs +++ b/PomoTime/MainPage.xaml.cs @@ -312,15 +312,7 @@ namespace PomoTime private void OnSuspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e) { var deferral = e.SuspendingOperation.GetDeferral(); - ApplicationDataContainer roamingSettings = Windows.Storage.ApplicationData.Current.RoamingSettings; - Windows.Storage.ApplicationDataCompositeValue minutes = new Windows.Storage.ApplicationDataCompositeValue(); - minutes["WorkMinutes"] = WorkMinutes; - minutes["BreakMinutes"] = BreakMinutes; - minutes["LongBreakMinutes"] = LongBreakMinutes; - roamingSettings.Values["Minutes"] = minutes; - SaveLocalState(); - deferral.Complete(); } @@ -335,6 +327,13 @@ namespace PomoTime localSettings.Values["IsRunning"] = MainViewRunningState.IsRunning; localSettings.Values["PreviousShortBreaks"] = MainViewRunningState.PreviousShortBreaks; localSettings.Values["CurrentPeriod"] = (int)MainViewRunningState.CurrentPeriod; + + ApplicationDataContainer roamingSettings = Windows.Storage.ApplicationData.Current.RoamingSettings; + Windows.Storage.ApplicationDataCompositeValue minutes = new Windows.Storage.ApplicationDataCompositeValue(); + minutes["WorkMinutes"] = WorkMinutes; + minutes["BreakMinutes"] = BreakMinutes; + minutes["LongBreakMinutes"] = LongBreakMinutes; + roamingSettings.Values["Minutes"] = minutes; } private void FastForwardTime(DateTime since)