Переглянути джерело

Merge pull request #2412 from Yidadaa/fix-2409

fix: #2409 empty prompt id cause crash
Yifei Zhang 1 рік тому
батько
коміт
f7e4b36746
1 змінених файлів з 1 додано та 1 видалено
  1. 1 1
      app/components/mask.tsx

+ 1 - 1
app/components/mask.tsx

@@ -215,7 +215,7 @@ function ContextPromptItem(props: {
   const [focusingInput, setFocusingInput] = useState(false);
   const [focusingInput, setFocusingInput] = useState(false);
 
 
   return (
   return (
-    <Draggable draggableId={props.prompt.id.toString()} index={props.index}>
+    <Draggable draggableId={props.prompt.id || props.index.toString()} index={props.index}>
       {(provided) => (
       {(provided) => (
         <div
         <div
           className={chatStyle["context-prompt-row"]}
           className={chatStyle["context-prompt-row"]}