Commit a07807b
fix(frontend): gate credits API calls behind buyCredits feature flag
The backend returns 404 for /credits/summary and /credits/batches/expiring
when BUY_CREDITS_ACTIVE is disabled. SessionEnsurer was polling /credits/summary
every 30 s and ExpiryWarningBanner was polling /credits/batches/expiring every
5 min for all authenticated users, flooding the console with 404 errors and
adding unnecessary network overhead.
Both queries now use `enabled: !!session?.data && !!features?.buyCredits` so
they only fire when the feature flag is actually on. ExpiryWarningBanner also
gains the useUserStore import needed to read the flag.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent ca24477 commit a07807b
2 files changed
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| 24 | + | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
29 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
30 | 34 | | |
31 | 35 | | |
32 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
65 | 67 | | |
66 | 68 | | |
67 | 69 | | |
| |||
0 commit comments