mirror of
https://codeberg.org/vyn/mirai.git
synced 2025-07-02 01:13:19 +00:00
Fix tasks being unscheduled if the day for the task already exists
This commit is contained in:
parent
dee7a6fa42
commit
3e7c9b150a
6 changed files with 26 additions and 6 deletions
7
external/mirai-core/src/View.cpp
vendored
7
external/mirai-core/src/View.cpp
vendored
|
@ -63,12 +63,15 @@ void View::update()
|
|||
for (auto day : source->getDays()) {
|
||||
// day's tasks
|
||||
auto sourceTasks = day.tasks() | std::ranges::views::filter([&](const Task &task) {
|
||||
if (day.date() >= todayDate) {
|
||||
return true;
|
||||
}
|
||||
if (shouldHideCompletedTasks()) {
|
||||
return task.checked() == false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
if (std::ranges::distance(sourceTasks) > 0) {
|
||||
if (day.date() >= todayDate || std::ranges::distance(sourceTasks) > 0) {
|
||||
|
||||
if (!dates.contains(day.date())) {
|
||||
dates.insert_or_assign(day.date(), DateView{});
|
||||
|
@ -85,7 +88,7 @@ void View::update()
|
|||
}).has_value();
|
||||
});
|
||||
|
||||
if (std::ranges::distance(sourceEvents) > 0) {
|
||||
if (day.date() >= todayDate || std::ranges::distance(sourceEvents) > 0) {
|
||||
if (!dates.contains(day.date())) {
|
||||
dates.insert_or_assign(day.date(), DateView{});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue