refactor: improve code quality and consistency

Changes:
1. Remove unused variable in useSettings.ts (readPersistedLanguage)
2. Replace manual state management with React Query in UsageFooter
   - Create useUsageQuery hook with 5-minute cache
   - Simplify component from 227 lines to 81 lines (-64%)
   - Improve consistency with project's React Query pattern
   - Enable automatic refetch and error handling
This commit is contained in:
Jason
2025-10-17 19:18:10 +08:00
parent d9c56511b1
commit 0cff882a3f
3 changed files with 27 additions and 49 deletions

View File

@@ -69,7 +69,6 @@ export function useSettings(): UseSettingsResult {
initialLanguage,
updateSettings,
resetSettings: resetForm,
readPersistedLanguage,
syncLanguage,
} = useSettingsForm();