- fix: new tasks counter failed for newly created lists

This commit is contained in:
maxpozdeev 2023-09-17 16:15:23 +03:00
parent ab9f398d7b
commit 1efbe606fd

View file

@ -260,7 +260,7 @@ class TasksController extends ApiController {
checkReadAccess();
$lists = $this->req->jsonBody['lists'] ?? [];
if (!is_array($lists)) $lists = [];
$userLists = [];
$userLists = []; // [string]
if (!haveWriteAccess()) {
$userLists = $this->getUserListsSimple(true);
if ($userLists) {
@ -273,9 +273,7 @@ class TasksController extends ApiController {
}
$sqlWhereList = [];
foreach ($lists as $item) {
if (!isset($item['later'])) continue;
$later = (int)$item['later'];
if ($later <= 0) continue;
$later = (int) ($item['later'] ?? 0);
$sqlWhereList[] = "(list_id = ". (int)$item['listId']. " AND compl=0 AND d_created > $later)";
}