refactor: remove unused functions and frontend declarations
- Remove four redundant Rust functions - Update tests to call the active implementations directly - Remove unused TypeScript state, parameters, and imports - Resolve unused-code compiler warnings
This commit is contained in:
1 parent
a9297b86cc
commit
0725f6ed8a
8 files changed
+25
-58
No files matched your search
@@ -423,7 +423,6 @@ export const exclusionsForModelSelection = (
|
||||
};
|
||||
|
||||
export const modelSelectionForDiscovery = (
|
||||
section: ProviderSection,
|
||||
configuredModels: ModelOption[],
|
||||
discoveredModels: ModelOption[],
|
||||
excludedModelsText: string,
|
||||
@@ -1773,7 +1772,7 @@ export function ApiProviderDialog({
|
||||
setSelectedModelNames((current) =>
|
||||
initialized
|
||||
? reconcileModelSelection(models, draft.models, current, 'refresh')
|
||||
: modelSelectionForDiscovery(activeSection, draft.models, models, draft.excludedModelsText ?? ''));
|
||||
: modelSelectionForDiscovery(draft.models, models, draft.excludedModelsText ?? ''));
|
||||
discoverySelectionInitializedRef.current = true;
|
||||
if (activeCategory === 'deepseek') setModelDiscoveryReady(true);
|
||||
if (!models.length) setModelError(t('apiAccess.error.noAvailableModels'));
|
||||
@@ -1792,7 +1791,7 @@ export function ApiProviderDialog({
|
||||
return;
|
||||
}
|
||||
discoverySelectionInitializedRef.current = false;
|
||||
setSelectedModelNames(modelSelectionForDiscovery(activeSection, draft.models, discoveredModels, draft.excludedModelsText ?? ''));
|
||||
setSelectedModelNames(modelSelectionForDiscovery(draft.models, discoveredModels, draft.excludedModelsText ?? ''));
|
||||
setModelDiscoveryOpen(true);
|
||||
void discoverModels();
|
||||
};
|
||||
|
||||
@@ -7,11 +7,9 @@ import {
|
||||
} from "react";
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
import {
|
||||
AlertCircle,
|
||||
ArrowLeft,
|
||||
ArrowRight,
|
||||
Check,
|
||||
CheckCircle2,
|
||||
ChevronDown,
|
||||
Languages,
|
||||
LoaderCircle,
|
||||
@@ -115,7 +113,6 @@ export function EasyModePage({
|
||||
const [activeStep, setActiveStep] = useState<SetupStep>(1);
|
||||
const [authMethod, setAuthMethod] = useState<AuthMethod>("oauth");
|
||||
|
||||
const [loadingSources, setLoadingSources] = useState(true);
|
||||
const [authFiles, setAuthFiles] = useState<Record<string, unknown>[]>([]);
|
||||
const [apiCounts, setApiCounts] = useState<Record<ApiSection, number>>({
|
||||
"openai-compatibility": 0,
|
||||
@@ -124,7 +121,6 @@ export function EasyModePage({
|
||||
gemini: 0,
|
||||
codex: 0,
|
||||
});
|
||||
const [availableModels, setAvailableModels] = useState<ModelOption[]>([]);
|
||||
|
||||
const [oauthLoggingIn, setOauthLoggingIn] = useState<OAuthProviderId | null>(null);
|
||||
const oauthFeedback = useAppNotice();
|
||||
@@ -168,7 +164,6 @@ export function EasyModePage({
|
||||
const [langMenuOpen, setLangMenuOpen] = useState(false);
|
||||
|
||||
const refreshSourceStatus = useCallback(async () => {
|
||||
setLoadingSources(true);
|
||||
try {
|
||||
const authFilesPayload = await managementApi.get("/auth-files");
|
||||
const files = responseList(authFilesPayload, "files");
|
||||
@@ -202,8 +197,6 @@ export function EasyModePage({
|
||||
setApiCounts(counts);
|
||||
} catch (e) {
|
||||
console.warn("Failed to refresh source status", e);
|
||||
} finally {
|
||||
setLoadingSources(false);
|
||||
}
|
||||
}, []);
|
||||
|
||||
|
||||
@@ -84,7 +84,6 @@ export function VersionManagementPage() {
|
||||
|
||||
const {
|
||||
status: coreStatus,
|
||||
statusError,
|
||||
refreshStatus,
|
||||
} = useCoreRuntime();
|
||||
const {
|
||||
|
||||
Reference in new issue
Block a user