Skip to content

Commit 71f718f

Browse files
authored
Merge pull request #5 from enga018/claude/cycles-till-date-filtering-d48wtg
Fix period-filter dropdown permanently stuck on empty options
2 parents 32690cb + 8416961 commit 71f718f

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

index.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,6 +1174,16 @@ <h4>Pending UPI payments <span id="pendingCount" class="pending-badge">0</span><
11741174
}
11751175
if(seq !== dashboardRefreshSeq) return; // superseded by a newer refresh; drop this stale result
11761176
allCitizens = list;
1177+
// The period dropdown's cache (unpaidCache/periodsReady) was built from
1178+
// whatever allCitizens looked like at the time it was requested. If that
1179+
// happened before the very first citizen list arrived (e.g. someone opens
1180+
// the dropdown right after login), it would otherwise permanently cache an
1181+
// empty result — periodsReady stays true forever with no periods listed.
1182+
// Invalidating it here means the next dropdown focus (or an already-active
1183+
// period filter, re-checked by renderList below) recomputes against
1184+
// current data instead of a possibly-stale/empty snapshot.
1185+
periodsReady = false;
1186+
unpaidCache = new Map();
11771187
renderStats(); renderList(); refreshPending();
11781188
}
11791189
function renderStats(){

0 commit comments

Comments
 (0)