Click to edit UI (#385)
- [x] add e2e test - happy case (make sure it clears selection and next prompt is empty, and preview is cleared); de-selection case - [x] shim - old & new file - [x] upgrade path - [x] add docs - [x] add try-catch to parser script - [x] make it work for next.js - [x] extract npm package - [x] make sure plugin doesn't apply in prod
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { useCallback } from "react";
|
||||
import type { Message } from "@/ipc/ipc_types";
|
||||
import type { ComponentSelection, Message } from "@/ipc/ipc_types";
|
||||
import { useAtom, useSetAtom } from "jotai";
|
||||
import {
|
||||
chatErrorAtom,
|
||||
@@ -56,11 +56,13 @@ export function useStreamChat({
|
||||
chatId,
|
||||
redo,
|
||||
attachments,
|
||||
selectedComponent,
|
||||
}: {
|
||||
prompt: string;
|
||||
chatId: number;
|
||||
redo?: boolean;
|
||||
attachments?: File[];
|
||||
selectedComponent?: ComponentSelection | null;
|
||||
}) => {
|
||||
if (
|
||||
(!prompt.trim() && (!attachments || attachments.length === 0)) ||
|
||||
@@ -74,6 +76,7 @@ export function useStreamChat({
|
||||
let hasIncrementedStreamCount = false;
|
||||
try {
|
||||
IpcClient.getInstance().streamMessage(prompt, {
|
||||
selectedComponent: selectedComponent ?? null,
|
||||
chatId,
|
||||
redo,
|
||||
attachments,
|
||||
|
||||
Reference in New Issue
Block a user