Skip to content

Commit

Permalink
chore: fix types of value tag input
Browse files Browse the repository at this point in the history
  • Loading branch information
urmauur committed Nov 25, 2024
1 parent 4ce8aa4 commit cee5d38
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 7 deletions.
5 changes: 4 additions & 1 deletion web/containers/EngineSetting/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import SettingComponentBuilder from '@/containers/ModelSetting/SettingComponent'

type Props = {
componentData: SettingComponentProps[]
onValueChanged: (key: string, value: string | number | boolean) => void
onValueChanged: (
key: string,
value: string | number | boolean | string[]
) => void
disabled?: boolean
}

Expand Down
2 changes: 1 addition & 1 deletion web/screens/LocalServer/LocalServerRightPanel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const LocalServerRightPanel = () => {
}, [currentModelSettingParams, setLocalAPIserverModelParams])

const onValueChanged = useCallback(
(key: string, value: string | number | boolean) => {
(key: string, value: string | number | boolean | string[]) => {
setCurrentModelSettingParams((prevParams) => ({
...prevParams,
[key]: value,
Expand Down
2 changes: 1 addition & 1 deletion web/screens/Settings/ExtensionSetting/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const ExtensionSetting = () => {

const onValueChanged = async (
key: string,
value: string | number | boolean
value: string | number | boolean | string[]
) => {
// find the key in settings state, update it and set the state back
const newSettings = settings.map((setting) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const SettingDetailTextInputItem = ({
}, [])

const copy = useCallback(() => {
navigator.clipboard.writeText(value)
navigator.clipboard.writeText(value as string)
if (value.length > 0) {
setCopied(true)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import SettingDetailToggleItem from './SettingDetailToggleItem'

type Props = {
componentProps: SettingComponentProps[]
onValueUpdated: (key: string, value: string | number | boolean) => void
onValueUpdated: (
key: string,
value: string | number | boolean | string[]
) => void
}

const SettingDetailItem = ({ componentProps, onValueUpdated }: Props) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const AssistantSetting: React.FC<Props> = ({ componentData }) => {
const setEngineParamsUpdate = useSetAtom(engineParamsUpdateAtom)

const onValueChanged = useCallback(
(key: string, value: string | number | boolean) => {
(key: string, value: string | number | boolean | string[]) => {
if (!activeThread) return
const shouldReloadModel =
componentData.find((x) => x.key === key)?.requireModelReload ?? false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const PromptTemplateSetting: React.FC<Props> = ({ componentData }) => {

const setEngineParamsUpdate = useSetAtom(engineParamsUpdateAtom)
const onValueChanged = useCallback(
(key: string, value: string | number | boolean) => {
(key: string, value: string | number | boolean | string[]) => {
if (!activeThread) return

setEngineParamsUpdate(true)
Expand Down

0 comments on commit cee5d38

Please sign in to comment.