move some things around so they make more sense

This commit is contained in:
2020-06-06 19:02:23 +03:00
parent 966bff1791
commit 7bcc2ed7d0
2 changed files with 8 additions and 9 deletions

View File

@@ -83,7 +83,7 @@ namespace PomoTime
// Ensure the current window is active // Ensure the current window is active
Window.Current.Activate(); Window.Current.Activate();
} }
if (e is ToastNotificationActivatedEventArgs) else if (e is ToastNotificationActivatedEventArgs)
{ {
var toastActivationArgs = e as ToastNotificationActivatedEventArgs; var toastActivationArgs = e as ToastNotificationActivatedEventArgs;

View File

@@ -312,15 +312,7 @@ namespace PomoTime
private void OnSuspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e) private void OnSuspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e)
{ {
var deferral = e.SuspendingOperation.GetDeferral(); 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(); SaveLocalState();
deferral.Complete(); deferral.Complete();
} }
@@ -335,6 +327,13 @@ namespace PomoTime
localSettings.Values["IsRunning"] = MainViewRunningState.IsRunning; localSettings.Values["IsRunning"] = MainViewRunningState.IsRunning;
localSettings.Values["PreviousShortBreaks"] = MainViewRunningState.PreviousShortBreaks; localSettings.Values["PreviousShortBreaks"] = MainViewRunningState.PreviousShortBreaks;
localSettings.Values["CurrentPeriod"] = (int)MainViewRunningState.CurrentPeriod; 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) private void FastForwardTime(DateTime since)