Skip to content

Commit d299f71

Browse files
Merge pull request #117 from NessieCanCode/fix-data-loading-in-detailed-transactions
Clear stale data when switching billing periods
2 parents 9e3ebba + 231165b commit d299f71

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/slurmcostmanager.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ function useBillingData(period) {
5454

5555
const load = useCallback(async () => {
5656
const id = ++requestIdRef.current;
57+
// Clear out existing data while loading a new period so that views
58+
// such as "Detailed Transactions" don't momentarily display data
59+
// from the previously selected period (e.g. the fiscal year) when
60+
// navigating directly between views.
61+
setData(null);
62+
setError(null);
5763
try {
5864
let json;
5965
if (window.cockpit && window.cockpit.spawn) {

0 commit comments

Comments
 (0)