()
| 396 | * Preserves any `rateLimitsByModel` snapshot from the prior session so the |
| 397 | * banner can show today's premium-session count without an extra fetch. */ |
| 398 | export function markFreebuffSessionEnded(): void { |
| 399 | if (!IS_FREEBUFF) return |
| 400 | controller?.abort() |
| 401 | const current = useFreebuffSessionStore.getState().session |
| 402 | const rateLimitsByModel = getRateLimitsByModel(current) |
| 403 | controller?.apply({ |
| 404 | status: 'ended', |
| 405 | accessTier: |
| 406 | current && 'accessTier' in current ? current.accessTier : undefined, |
| 407 | rateLimitsByModel, |
| 408 | }) |
| 409 | } |
| 410 | |
| 411 | interface UseFreebuffSessionResult { |
| 412 | session: FreebuffSessionResponse | null |
no test coverage detected