Fix notifications 'Active Only' filter showing completed notifications
Issue: Active Only mode was showing notifications marked isactive=1 even if their endtime had passed, displaying them with 'Complete' status. Root Cause: WHERE clause only checked isactive=1, not whether endtime < NOW() Fix: Updated WHERE clause to exclude notifications past their endtime: - Active notifications now require: isactive=1 AND (endtime IS NULL OR endtime >= NOW()) - Still shows recently completed notifications within 30-min grace period for fade-out - 'Active Only' badge now accurately reflects truly active notifications Impact: Users will no longer see 'Complete' notifications when filtering to Active Only 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -96,8 +96,11 @@
|
|||||||
|
|
||||||
' Add WHERE clause based on showall parameter
|
' Add WHERE clause based on showall parameter
|
||||||
If showAll <> "1" Then
|
If showAll <> "1" Then
|
||||||
|
' Show only truly active notifications:
|
||||||
|
' 1. isactive = 1 AND (endtime is NULL OR endtime >= NOW())
|
||||||
|
' 2. OR recently completed (within 30 min grace period for fade-out)
|
||||||
strSQL = strSQL & _
|
strSQL = strSQL & _
|
||||||
"WHERE n.isactive = 1 OR " & _
|
"WHERE (n.isactive = 1 AND (n.endtime IS NULL OR n.endtime >= NOW())) OR " & _
|
||||||
" (n.isactive = 0 AND n.endtime IS NOT NULL AND " & _
|
" (n.isactive = 0 AND n.endtime IS NOT NULL AND " & _
|
||||||
" DATE_ADD(n.endtime, INTERVAL 30 MINUTE) >= NOW()) "
|
" DATE_ADD(n.endtime, INTERVAL 30 MINUTE) >= NOW()) "
|
||||||
End If
|
End If
|
||||||
|
|||||||
Reference in New Issue
Block a user