chore: http remove blank to value

This commit is contained in:
Joel 2024-03-19 18:08:09 +08:00
parent 43429108f5
commit 49dd5b76f1
1 changed files with 1 additions and 1 deletions

View File

@ -12,7 +12,7 @@ const strToKeyValueList = (value: string) => {
const useKeyValueList = (value: string, onChange: (value: string) => void) => {
const [list, setList] = useState<KeyValue[]>(value ? strToKeyValueList(value) : [])
useEffect(() => {
const newValue = list.filter(item => item.key && item.value).map(item => `${item.key}: ${item.value}`).join('\n')
const newValue = list.filter(item => item.key && item.value).map(item => `${item.key}:${item.value}`).join('\n')
if (newValue !== value)
onChange(newValue)