fix a possible issue with notifications not being delivered at correct time
This commit is contained in:
2020-05-10 17:08:18 +03:00
parent 95feea243f
commit 966bff1791
2 changed files with 24 additions and 1 deletions

View File

@@ -231,6 +231,21 @@ namespace PomoTime
}
}
private void RescheduleNotification()
{
ClearScheduledNotifications();
if(!MainViewRunningState.IsRunning)
{
return;
}
if (MainViewRunningState.MinutesLeft != 0 || MainViewRunningState.SecondsLeft != 0)
{
SchedulePeriodOverNotification();
}
}
private void PlayButton_Click(object sender, RoutedEventArgs e)
{
@@ -275,18 +290,24 @@ namespace PomoTime
{
AppBarButton b = sender as AppBarButton;
MainViewRunningState.MinutesLeft += 1;
RescheduleNotification();
}
private void Plus5Button_Click(object sender, RoutedEventArgs e)
{
AppBarButton b = sender as AppBarButton;
MainViewRunningState.MinutesLeft += 5;
RescheduleNotification();
}
private void Plus10Button_Click(object sender, RoutedEventArgs e)
{
AppBarButton b = sender as AppBarButton;
MainViewRunningState.MinutesLeft += 10;
RescheduleNotification();
}
private void OnSuspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e)
{
@@ -394,6 +415,8 @@ namespace PomoTime
Reset();
SaveLocalState();
}
RescheduleNotification();
}
}

View File

@@ -9,7 +9,7 @@
<Identity
Name="44844StepanUsatyuk.PomoTime"
Publisher="CN=D7EE55C2-4D4B-40F8-8EE5-CC4CEBCE2133"
Version="1.0.8.0" />
Version="1.0.9.0" />
<mp:PhoneIdentity PhoneProductId="4d8bddac-8ab7-4c19-b3c7-7b5a27b87594" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>