fix: copy multi lines when ==
This commit is contained in:
@@ -80,13 +80,12 @@ const LabelSelector: React.FC<LabelSelectorProps> = ({
|
|||||||
if (!clipboardText || clipboardText.indexOf('=') === -1) return;
|
if (!clipboardText || clipboardText.indexOf('=') === -1) return;
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
const lines = clipboardText
|
const lines = _.split(clipboardText, /\r?\n/)
|
||||||
.split(/\r?\n/)
|
.map((line: string) => line.trim())
|
||||||
.map((line) => line.trim())
|
.filter((line: string) => line && line.includes('='));
|
||||||
.filter((line) => line && line.includes('='));
|
|
||||||
|
|
||||||
const parsedData = lines.map((line) => {
|
const parsedData = lines.map((line: string) => {
|
||||||
const [key, value] = line.split('=').map((part) => part.trim());
|
const [key, value] = line.split(/=(.+)/).map((s) => s.trim());
|
||||||
return { key, value };
|
return { key, value };
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,6 @@ export default function useChatCompletion(
|
|||||||
_.get(chunk, 'choices.0.delta.content', '') === null
|
_.get(chunk, 'choices.0.delta.content', '') === null
|
||||||
? ''
|
? ''
|
||||||
: _.get(chunk, 'choices.0.delta.content', '');
|
: _.get(chunk, 'choices.0.delta.content', '');
|
||||||
console.log('deltaContent:', deltaContent);
|
|
||||||
|
|
||||||
reasonContentRef.current = reasonContentRef.current + deltaReasoningContent;
|
reasonContentRef.current = reasonContentRef.current + deltaReasoningContent;
|
||||||
contentRef.current = contentRef.current + deltaContent;
|
contentRef.current = contentRef.current + deltaContent;
|
||||||
|
|||||||
Reference in New Issue
Block a user