mirror of
https://github.com/usatiuk/PomoTime.git
synced 2025-10-29 00:47:48 +01:00
v1.0.11.0 fix an issue when timer's state might not be restored on launch
This commit is contained in:
@@ -44,6 +44,16 @@ namespace PomoTime
|
|||||||
{
|
{
|
||||||
Frame rootFrame = Window.Current.Content as Frame;
|
Frame rootFrame = Window.Current.Content as Frame;
|
||||||
|
|
||||||
|
ApplicationDataContainer localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;
|
||||||
|
if (localSettings.Values["MinutesLeft"] != null)
|
||||||
|
{
|
||||||
|
RunningState.MinutesLeft = (int)localSettings.Values["MinutesLeft"];
|
||||||
|
RunningState.SecondsLeft = (int)localSettings.Values["SecondsLeft"];
|
||||||
|
RunningState.IsRunning = (bool)localSettings.Values["IsRunning"];
|
||||||
|
RunningState.PreviousShortBreaks = (int)localSettings.Values["PreviousShortBreaks"];
|
||||||
|
RunningState.CurrentPeriod = (Period)localSettings.Values["CurrentPeriod"];
|
||||||
|
}
|
||||||
|
|
||||||
// Do not repeat app initialization when the Window already has content,
|
// Do not repeat app initialization when the Window already has content,
|
||||||
// just ensure that the window is active
|
// just ensure that the window is active
|
||||||
if (rootFrame == null)
|
if (rootFrame == null)
|
||||||
@@ -55,17 +65,7 @@ namespace PomoTime
|
|||||||
|
|
||||||
if (e.PreviousExecutionState == ApplicationExecutionState.Terminated
|
if (e.PreviousExecutionState == ApplicationExecutionState.Terminated
|
||||||
|| e.PreviousExecutionState == ApplicationExecutionState.ClosedByUser)
|
|| e.PreviousExecutionState == ApplicationExecutionState.ClosedByUser)
|
||||||
{
|
{}
|
||||||
ApplicationDataContainer localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;
|
|
||||||
if (localSettings.Values["MinutesLeft"] != null)
|
|
||||||
{
|
|
||||||
RunningState.MinutesLeft = (int)localSettings.Values["MinutesLeft"];
|
|
||||||
RunningState.SecondsLeft = (int)localSettings.Values["SecondsLeft"];
|
|
||||||
RunningState.IsRunning = (bool)localSettings.Values["IsRunning"];
|
|
||||||
RunningState.PreviousShortBreaks = (int)localSettings.Values["PreviousShortBreaks"];
|
|
||||||
RunningState.CurrentPeriod = (Period)localSettings.Values["CurrentPeriod"];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Place the frame in the current Window
|
// Place the frame in the current Window
|
||||||
Window.Current.Content = rootFrame;
|
Window.Current.Content = rootFrame;
|
||||||
@@ -87,16 +87,6 @@ namespace PomoTime
|
|||||||
{
|
{
|
||||||
var toastActivationArgs = e as ToastNotificationActivatedEventArgs;
|
var toastActivationArgs = e as ToastNotificationActivatedEventArgs;
|
||||||
|
|
||||||
ApplicationDataContainer localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;
|
|
||||||
if (localSettings.Values["MinutesLeft"] != null)
|
|
||||||
{
|
|
||||||
RunningState.MinutesLeft = (int)localSettings.Values["MinutesLeft"];
|
|
||||||
RunningState.SecondsLeft = (int)localSettings.Values["SecondsLeft"];
|
|
||||||
RunningState.IsRunning = (bool)localSettings.Values["IsRunning"];
|
|
||||||
RunningState.PreviousShortBreaks = (int)localSettings.Values["PreviousShortBreaks"];
|
|
||||||
RunningState.CurrentPeriod = (Period)localSettings.Values["CurrentPeriod"];
|
|
||||||
}
|
|
||||||
|
|
||||||
QueryString args = QueryString.Parse(toastActivationArgs.Argument);
|
QueryString args = QueryString.Parse(toastActivationArgs.Argument);
|
||||||
if (args.Contains("action"))
|
if (args.Contains("action"))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<Identity
|
<Identity
|
||||||
Name="44844StepanUsatyuk.PomoTime"
|
Name="44844StepanUsatyuk.PomoTime"
|
||||||
Publisher="CN=D7EE55C2-4D4B-40F8-8EE5-CC4CEBCE2133"
|
Publisher="CN=D7EE55C2-4D4B-40F8-8EE5-CC4CEBCE2133"
|
||||||
Version="1.0.10.0" />
|
Version="1.0.11.0" />
|
||||||
|
|
||||||
<mp:PhoneIdentity PhoneProductId="4d8bddac-8ab7-4c19-b3c7-7b5a27b87594" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
|
<mp:PhoneIdentity PhoneProductId="4d8bddac-8ab7-4c19-b3c7-7b5a27b87594" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user