fix: applied gemini suggestions

This commit is contained in:
alina sireneva
2026-02-06 17:38:56 +03:00
parent 370eee1346
commit 78ab061750
2 changed files with 13 additions and 12 deletions

View File

@@ -443,14 +443,13 @@ const fetchClaudeQuota = async (
const { organization } = JSON.parse(profileRes.bodyText) as ClaudeProfileResponse; const { organization } = JSON.parse(profileRes.bodyText) as ClaudeProfileResponse;
const tier = organization?.rate_limit_tier const tier = organization?.rate_limit_tier
let planType = "plan_unknown" const tierToPlanMap: Record<string, string> = {
if (tier === "default_claude_max_5x") { 'default_claude_max_5x': 'plan_max5',
planType = "plan_max5" 'default_claude_max_20x': 'plan_max20',
} else if (tier === "default_claude_max_20x") { 'default_claude_pro': 'plan_pro',
planType = "plan_max20" 'default_claude_ai': 'plan_free',
} else if (tier === "default_claude_ai") { };
planType = "plan_free" const planType = tierToPlanMap[tier ?? ''] ?? 'plan_unknown';
}
const usage = JSON.parse(usageRes.bodyText) as ClaudeUsageResponse const usage = JSON.parse(usageRes.bodyText) as ClaudeUsageResponse
return { planType, usage }; return { planType, usage };
@@ -641,7 +640,7 @@ const renderClaudeItems = (
type Window = { type Window = {
key: string key: string
usage: number usage: number | null
resetDate: Date resetDate: Date
} }
const windows: Window[] = [] const windows: Window[] = []
@@ -649,21 +648,21 @@ const renderClaudeItems = (
if (usage.five_hour) { if (usage.five_hour) {
windows.push({ windows.push({
key: 'primary_window', key: 'primary_window',
usage: usage.five_hour.utilization ?? 0, usage: usage.five_hour.utilization,
resetDate: new Date(usage.five_hour.resets_at) resetDate: new Date(usage.five_hour.resets_at)
}) })
} }
if (usage.seven_day) { if (usage.seven_day) {
windows.push({ windows.push({
key: 'secondary_window', key: 'secondary_window',
usage: usage.seven_day.utilization ?? 0, usage: usage.seven_day.utilization,
resetDate: new Date(usage.seven_day.resets_at) resetDate: new Date(usage.seven_day.resets_at)
}) })
} }
if (usage.seven_day_sonnet) { if (usage.seven_day_sonnet) {
windows.push({ windows.push({
key: 'sonnet_window', key: 'sonnet_window',
usage: usage.seven_day_sonnet.utilization ?? 0, usage: usage.seven_day_sonnet.utilization,
resetDate: new Date(usage.seven_day_sonnet.resets_at) resetDate: new Date(usage.seven_day_sonnet.resets_at)
}) })
} }

View File

@@ -36,6 +36,7 @@ import {
} from '@/utils/usage'; } from '@/utils/usage';
import { formatFileSize } from '@/utils/format'; import { formatFileSize } from '@/utils/format';
import styles from './AuthFilesPage.module.scss'; import styles from './AuthFilesPage.module.scss';
import { CLAUDE_CONFIG } from '../components/quota/quotaConfigs.ts';
type ThemeColors = { bg: string; text: string; border?: string }; type ThemeColors = { bg: string; text: string; border?: string };
type TypeColorSet = { light: ThemeColors; dark?: ThemeColors }; type TypeColorSet = { light: ThemeColors; dark?: ThemeColors };
@@ -1466,6 +1467,7 @@ export function AuthFilesPage() {
const getQuotaConfig = (type: QuotaProviderType) => { const getQuotaConfig = (type: QuotaProviderType) => {
if (type === 'antigravity') return ANTIGRAVITY_CONFIG; if (type === 'antigravity') return ANTIGRAVITY_CONFIG;
if (type === 'codex') return CODEX_CONFIG; if (type === 'codex') return CODEX_CONFIG;
if (type === 'claude') return CLAUDE_CONFIG;
return GEMINI_CLI_CONFIG; return GEMINI_CLI_CONFIG;
}; };