refactor(endpoint): separate edit and create mode endpoint management (#192)

Optimize custom endpoint management logic to distinguish between edit and create modes:
- Edit mode: endpoints are read/written directly to backend via API
- Create mode: use draftCustomEndpoints to stage, save on submit
- Remove duplicate endpoint loading in useSpeedTestEndpoints
- Add isSaving state and initialCustomUrls tracking
This commit is contained in:
YoVinchen
2025-11-12 11:02:43 +08:00
committed by GitHub
parent 8a05e7bd3d
commit 346f916048
5 changed files with 185 additions and 158 deletions

View File

@@ -24,7 +24,7 @@ interface CodexFormFieldsProps {
onBaseUrlChange: (url: string) => void;
isEndpointModalOpen: boolean;
onEndpointModalToggle: (open: boolean) => void;
onCustomEndpointsChange: (endpoints: string[]) => void;
onCustomEndpointsChange?: (endpoints: string[]) => void;
// Speed Test Endpoints
speedTestEndpoints: EndpointCandidate[];