@projectservan8n/cnapse 0.5.4 → 0.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +4 -3
- package/package.json +1 -1
- package/src/components/App.tsx +4 -2
package/dist/index.js
CHANGED
|
@@ -1912,6 +1912,7 @@ function App() {
|
|
|
1912
1912
|
const [overlay, setOverlay] = useState7("none");
|
|
1913
1913
|
const [screenWatch, setScreenWatch] = useState7(false);
|
|
1914
1914
|
const [status, setStatus] = useState7("Ready");
|
|
1915
|
+
const [inputValue, setInputValue] = useState7("");
|
|
1915
1916
|
const chat2 = useChat(screenWatch);
|
|
1916
1917
|
const vision = useVision();
|
|
1917
1918
|
const telegram = useTelegram((msg) => {
|
|
@@ -2071,6 +2072,7 @@ ${tasks.format(task)}`);
|
|
|
2071
2072
|
}, [chat2, tasks]);
|
|
2072
2073
|
const handleSubmit = useCallback5(async (value) => {
|
|
2073
2074
|
if (!value.trim()) return;
|
|
2075
|
+
setInputValue("");
|
|
2074
2076
|
if (value.startsWith("/")) {
|
|
2075
2077
|
await handleCommand(value);
|
|
2076
2078
|
} else {
|
|
@@ -2127,9 +2129,8 @@ ${tasks.format(task)}`);
|
|
|
2127
2129
|
/* @__PURE__ */ jsx7(
|
|
2128
2130
|
ChatInput,
|
|
2129
2131
|
{
|
|
2130
|
-
value:
|
|
2131
|
-
onChange:
|
|
2132
|
-
},
|
|
2132
|
+
value: inputValue,
|
|
2133
|
+
onChange: setInputValue,
|
|
2133
2134
|
onSubmit: handleSubmit,
|
|
2134
2135
|
isProcessing
|
|
2135
2136
|
}
|
package/package.json
CHANGED
package/src/components/App.tsx
CHANGED
|
@@ -18,6 +18,7 @@ export function App() {
|
|
|
18
18
|
const [overlay, setOverlay] = useState<OverlayType>('none');
|
|
19
19
|
const [screenWatch, setScreenWatch] = useState(false);
|
|
20
20
|
const [status, setStatus] = useState('Ready');
|
|
21
|
+
const [inputValue, setInputValue] = useState('');
|
|
21
22
|
|
|
22
23
|
// Feature hooks
|
|
23
24
|
const chat = useChat(screenWatch);
|
|
@@ -204,6 +205,7 @@ export function App() {
|
|
|
204
205
|
// Submit handler
|
|
205
206
|
const handleSubmit = useCallback(async (value: string) => {
|
|
206
207
|
if (!value.trim()) return;
|
|
208
|
+
setInputValue(''); // Clear input immediately
|
|
207
209
|
|
|
208
210
|
if (value.startsWith('/')) {
|
|
209
211
|
await handleCommand(value);
|
|
@@ -270,8 +272,8 @@ export function App() {
|
|
|
270
272
|
)}
|
|
271
273
|
|
|
272
274
|
<ChatInput
|
|
273
|
-
value=
|
|
274
|
-
onChange={
|
|
275
|
+
value={inputValue}
|
|
276
|
+
onChange={setInputValue}
|
|
275
277
|
onSubmit={handleSubmit}
|
|
276
278
|
isProcessing={isProcessing}
|
|
277
279
|
/>
|