This repository was archived by the owner on May 15, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
src/api/providers/fetchers
webview-ui/src/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -119,7 +119,7 @@ export async function getFirmwareModels(apiKey?: string): Promise<ModelRecord> {
119119
120120export interface FirmwareQuotaResponse {
121121 used : number // 0 to 1 scale (1 = limit reached)
122- reset : string // ISO timestamp when quota resets
122+ reset : string | null // ISO timestamp when quota resets, null if window hasn't started
123123}
124124
125125/**
@@ -160,7 +160,7 @@ export async function getFirmwareQuota(apiKey: string): Promise<FirmwareQuotaRes
160160
161161 return {
162162 used : data . used ?? 0 ,
163- reset : data . reset ?? new Date ( ) . toISOString ( ) ,
163+ reset : data . reset ?? null ,
164164 }
165165 } finally {
166166 clearTimeout ( timeoutId )
Original file line number Diff line number Diff line change @@ -18,16 +18,20 @@ export const FirmwareQuotaDisplay = () => {
1818 }
1919
2020 const percentUsed = ( quota . used * 100 ) . toFixed ( 2 )
21- const resetDate = new Date ( quota . reset )
22- const now = new Date ( )
23- const msUntilReset = resetDate . getTime ( ) - now . getTime ( )
21+
22+ // Calculate reset time only if reset is provided
23+ let resetText = ""
24+ if ( quota . reset ) {
25+ const resetDate = new Date ( quota . reset )
26+ const now = new Date ( )
27+ const msUntilReset = resetDate . getTime ( ) - now . getTime ( )
28+ resetText = ` · resets in ${ formatTimeUntilReset ( msUntilReset ) } `
29+ }
2430
2531 const isAtLimit = quota . used >= 1
2632 const isWarning = quota . used >= 0.8
2733
28- const statusText = isAtLimit
29- ? `Limit reached · resets in ${ formatTimeUntilReset ( msUntilReset ) } `
30- : `${ percentUsed } % used · resets in ${ formatTimeUntilReset ( msUntilReset ) } `
34+ const statusText = isAtLimit ? `Limit reached${ resetText } ` : `${ percentUsed } % used${ resetText } `
3135
3236 const colorClass = isAtLimit
3337 ? "text-vscode-errorForeground"
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import { vscode } from "@src/utils/vscode"
66
77export interface FirmwareQuotaInfo {
88 used : number // 0 to 1 scale (1 = limit reached)
9- reset : string // ISO timestamp when quota resets
9+ reset : string | null // ISO timestamp when quota resets, null if window hasn't started
1010}
1111
1212export const useFirmwareQuota = ( ) => {
You can’t perform that action at this time.
0 commit comments