mirror of
https://github.com/langgenius/dify.git
synced 2026-04-30 23:48:04 +08:00
Merge branch 'main' into feat/plugins
This commit is contained in:
@ -72,7 +72,7 @@ const InputVarList: FC<Props> = ({
|
||||
}
|
||||
else {
|
||||
draft[variable] = {
|
||||
type: varKindType,
|
||||
type: VarKindType.variable,
|
||||
value: varValue,
|
||||
}
|
||||
}
|
||||
@ -171,7 +171,7 @@ const InputVarList: FC<Props> = ({
|
||||
value={varInput?.type === VarKindType.constant ? (varInput?.value || '') : (varInput?.value || [])}
|
||||
onChange={handleNotMixedTypeChange(variable)}
|
||||
onOpen={handleOpen(index)}
|
||||
defaultVarKindType={varInput?.type}
|
||||
defaultVarKindType={VarKindType.variable}
|
||||
filterVar={isNumber ? filterVar : undefined}
|
||||
availableVars={isSelect ? availableVars : undefined}
|
||||
schema={schema}
|
||||
|
||||
@ -47,10 +47,8 @@ export const getLocaleOnServer = (): Locale => {
|
||||
}
|
||||
|
||||
// Validate languages
|
||||
if (!Array.isArray(languages) || languages.length === 0 || !languages.every(lang => typeof lang === 'string' && /^[\w-]+$/.test(lang))) {
|
||||
console.error(`Invalid languages: ${languages}`)
|
||||
if (!Array.isArray(languages) || languages.length === 0 || !languages.every(lang => typeof lang === 'string' && /^[\w-]+$/.test(lang)))
|
||||
languages = [i18n.defaultLocale]
|
||||
}
|
||||
|
||||
// match locale
|
||||
const matchedLocale = match(languages, locales, i18n.defaultLocale) as Locale
|
||||
|
||||
Reference in New Issue
Block a user