style: format code with consistent spacing and line breaks
This commit is contained in:
@@ -85,9 +85,7 @@ export function AddProviderDialog({
|
||||
}
|
||||
} else if (appId === "codex") {
|
||||
const presets = codexProviderPresets;
|
||||
const presetIndex = parseInt(
|
||||
values.presetId.replace("codex-", ""),
|
||||
);
|
||||
const presetIndex = parseInt(values.presetId.replace("codex-", ""));
|
||||
if (
|
||||
!isNaN(presetIndex) &&
|
||||
presetIndex >= 0 &&
|
||||
@@ -109,8 +107,9 @@ export function AddProviderDialog({
|
||||
} else if (appId === "codex") {
|
||||
const config = parsedConfig.config as string | undefined;
|
||||
if (config) {
|
||||
const baseUrlMatch =
|
||||
config.match(/base_url\s*=\s*["']([^"']+)["']/);
|
||||
const baseUrlMatch = config.match(
|
||||
/base_url\s*=\s*["']([^"']+)["']/,
|
||||
);
|
||||
if (baseUrlMatch?.[1]) {
|
||||
addUrl(baseUrlMatch[1]);
|
||||
}
|
||||
|
||||
@@ -179,7 +179,11 @@ export function ProviderCard({
|
||||
/>
|
||||
</div>
|
||||
|
||||
<UsageFooter providerId={provider.id} appId={appId} usageEnabled={usageEnabled} />
|
||||
<UsageFooter
|
||||
providerId={provider.id}
|
||||
appId={appId}
|
||||
usageEnabled={usageEnabled}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -313,15 +313,7 @@ const EndpointSpeedTest: React.FC<EndpointSpeedTestProps> = ({
|
||||
setAddError(message || t("endpointTest.saveFailed"));
|
||||
console.error(t("endpointTest.addEndpointFailed"), error);
|
||||
}
|
||||
}, [
|
||||
customUrl,
|
||||
entries,
|
||||
normalizedSelected,
|
||||
onChange,
|
||||
appId,
|
||||
providerId,
|
||||
t,
|
||||
]);
|
||||
}, [customUrl, entries, normalizedSelected, onChange, appId, providerId, t]);
|
||||
|
||||
const handleRemoveEndpoint = useCallback(
|
||||
async (entry: EndpointEntry) => {
|
||||
|
||||
@@ -53,7 +53,12 @@ export function useApiKeyLink({
|
||||
}, [selectedPresetId, presetEntries, formWebsiteUrl]);
|
||||
|
||||
return {
|
||||
shouldShowApiKeyLink: appId === "claude" ? shouldShowApiKeyLink : appId === "codex" ? shouldShowApiKeyLink : false,
|
||||
shouldShowApiKeyLink:
|
||||
appId === "claude"
|
||||
? shouldShowApiKeyLink
|
||||
: appId === "codex"
|
||||
? shouldShowApiKeyLink
|
||||
: false,
|
||||
websiteUrl: getWebsiteUrl,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user