From 242159b571c41d12687510c305cb7b3c150cab7a Mon Sep 17 00:00:00 2001 From: LTbinglingfeng Date: Sat, 13 Jun 2026 01:56:07 +0800 Subject: [PATCH] perf(quota): drop discarded config.yaml prefetch The quota page fetched /config.yaml on mount and on every header refresh but ignored the response; quota sections never consume it. Remove the fetch to save a request per visit. --- src/pages/QuotaPage.tsx | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/src/pages/QuotaPage.tsx b/src/pages/QuotaPage.tsx index ad9b723..a28d07f 100644 --- a/src/pages/QuotaPage.tsx +++ b/src/pages/QuotaPage.tsx @@ -6,7 +6,7 @@ import { useCallback, useEffect, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useHeaderRefresh } from '@/hooks/useHeaderRefresh'; import { useAuthStore } from '@/stores'; -import { authFilesApi, configFileApi } from '@/services/api'; +import { authFilesApi } from '@/services/api'; import { QuotaSection, ANTIGRAVITY_CONFIG, @@ -29,15 +29,6 @@ export function QuotaPage() { const disableControls = connectionStatus !== 'connected'; - const loadConfig = useCallback(async () => { - try { - await configFileApi.fetchConfigYaml(); - } catch (err: unknown) { - const errorMessage = err instanceof Error ? err.message : t('notification.refresh_failed'); - setError((prev) => prev || errorMessage); - } - }, [t]); - const loadFiles = useCallback(async () => { setLoading(true); setError(''); @@ -52,16 +43,11 @@ export function QuotaPage() { } }, [t]); - const handleHeaderRefresh = useCallback(async () => { - await Promise.all([loadConfig(), loadFiles()]); - }, [loadConfig, loadFiles]); - - useHeaderRefresh(handleHeaderRefresh); + useHeaderRefresh(loadFiles); useEffect(() => { loadFiles(); - loadConfig(); - }, [loadFiles, loadConfig]); + }, [loadFiles]); return (