Skip to content

Commit a46c99d

Browse files
committed
fix notification status
fix previous PR
1 parent 136184b commit a46c99d

File tree

2 files changed

+12
-18
lines changed

2 files changed

+12
-18
lines changed

Denna/Core/Service/Todos/TodoService.cs

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,8 @@ public void AddTodo(Todo task)
3535

3636
public void Edit(Todo oldTask, Todo newTask)
3737
{
38-
39-
if (oldTask.StartTime != newTask.StartTime)
40-
newTask.UpdateNotification();
38+
newTask.UpdateNotification();
4139
repo.UpdatePrimary(newTask, newTask.Id);
42-
43-
4440
}
4541

4642

@@ -91,7 +87,7 @@ public void Undone(Todo task)
9187
task.CreateAlarm();
9288
}
9389
}
94-
90+
9591
}
9692

9793
public void Postpone(Todo task)
@@ -103,13 +99,13 @@ public void Postpone(Todo task)
10399
}
104100

105101
if (task.StartTime > DateTimeOffset.Now)
106-
if (task.Status != 1 || task.Status != 2)
107-
{
108-
if (task.Notify == 1)
109-
task.CreateNotification();
110-
if (task.Notify == 2)
111-
task.CreateAlarm();
112-
}
102+
if (task.Status != 1 || task.Status != 2)
103+
{
104+
if (task.Notify == 1)
105+
task.CreateNotification();
106+
if (task.Notify == 2)
107+
task.CreateAlarm();
108+
}
113109
}
114110
#endregion
115111
#region Queries

Denna/Denna/Views/SubMaster/Add/Task.xaml.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public Task()
2525
}
2626
protected override void OnNavigatedTo(NavigationEventArgs e)
2727
{
28-
28+
2929
if (e.Parameter is Todo)
3030
{
3131
editing = e.Parameter as Todo;
@@ -59,7 +59,7 @@ void AppBarButton_Click(object sender, RoutedEventArgs e)
5959
void AppBarButton_Click_1(object sender, RoutedEventArgs e)
6060
{
6161
var start = new DateTime(datepic.Date.Year, datepic.Date.Month, datepic.Date.Day, timepic.Time.Hours, timepic.Time.Minutes, timepic.Time.Seconds);
62-
62+
6363
if (Title.Text == "")
6464
{
6565
ErrorText.Text = "Please set a title for this alarm.";
@@ -73,7 +73,7 @@ void AppBarButton_Click_1(object sender, RoutedEventArgs e)
7373
return;
7474
}
7575

76-
76+
7777
int notiftStatus = 0;
7878
if (rbs.IsChecked == true)
7979
notiftStatus = 0;
@@ -93,8 +93,6 @@ void AppBarButton_Click_1(object sender, RoutedEventArgs e)
9393
};
9494
if (editmode)
9595
{
96-
DateTimeOffset d = todo.StartTime;
97-
d = editing.StartTime;
9896
todo.Id = editing.Id;
9997
_service.Edit(editing, todo);
10098
}

0 commit comments

Comments
 (0)