fix(i18n): improve label retrieval for paintings image size options

This commit is contained in:
kangfenmao 2025-11-03 14:45:21 +08:00
parent 32a84311aa
commit 11bf50e722
2 changed files with 4 additions and 3 deletions

View File

@ -239,7 +239,7 @@ const paintingsImageSizeOptionsKeyMap = {
} as const
export const getPaintingsImageSizeOptionsLabel = (key: string): string => {
return getLabel(paintingsImageSizeOptionsKeyMap, key)
return paintingsImageSizeOptionsKeyMap[key] ? getLabel(paintingsImageSizeOptionsKeyMap, key) : key
}
const paintingsQualityOptionsKeyMap = {

View File

@ -131,10 +131,11 @@ const PopupContainer: React.FC<Props> = ({ providerId, resolve }) => {
(model: Model) => {
if (!isEmpty(model.name)) {
if (isNewApiProvider(provider)) {
if (model.supported_endpoint_types && model.supported_endpoint_types.length > 0) {
const endpointTypes = model.supported_endpoint_types
if (endpointTypes && endpointTypes.length > 0) {
addModel({
...model,
endpoint_type: model.supported_endpoint_types[0],
endpoint_type: endpointTypes.includes('image-generation') ? 'image-generation' : endpointTypes[0],
supported_text_delta: !isNotSupportedTextDelta(model)
})
} else {