Fixed update shortcut not working

This commit is contained in:
Lucas Oliveira 2024-06-10 14:58:13 -03:00
commit 6d89ea555d
3 changed files with 10 additions and 4 deletions

View file

@ -260,6 +260,7 @@ export default function GenericNode({
openAdvancedModal={false} openAdvancedModal={false}
onCloseAdvancedModal={() => {}} onCloseAdvancedModal={() => {}}
selected={selected} selected={selected}
updateNode={handleUpdateCode}
/> />
</NodeToolbar> </NodeToolbar>
); );

View file

@ -46,6 +46,7 @@ export default function NodeToolbarComponent({
selected, selected,
setShowState, setShowState,
onCloseAdvancedModal, onCloseAdvancedModal,
updateNode,
}: nodeToolbarPropsType): JSX.Element { }: nodeToolbarPropsType): JSX.Element {
const version = useDarkStore((state) => state.version); const version = useDarkStore((state) => state.version);
const [showModalAdvanced, setShowModalAdvanced] = useState(false); const [showModalAdvanced, setShowModalAdvanced] = useState(false);
@ -307,6 +308,9 @@ export default function NodeToolbarComponent({
case "delete": case "delete":
deleteNode(data.id); deleteNode(data.id);
break; break;
case "update":
updateNode();
break;
case "copy": case "copy":
const node = nodes.filter((node) => node.id === data.id); const node = nodes.filter((node) => node.id === data.id);
setLastCopiedSelection({ nodes: _.cloneDeep(node), edges: [] }); setLastCopiedSelection({ nodes: _.cloneDeep(node), edges: [] });

View file

@ -491,7 +491,7 @@ export type ChatInputType = {
isDragging: boolean; isDragging: boolean;
files: FilePreviewType[]; files: FilePreviewType[];
setFiles: ( setFiles: (
files: FilePreviewType[] | ((prev: FilePreviewType[]) => FilePreviewType[]) files: FilePreviewType[] | ((prev: FilePreviewType[]) => FilePreviewType[]),
) => void; ) => void;
chatValue: string; chatValue: string;
inputRef: { inputRef: {
@ -547,6 +547,7 @@ export type nodeToolbarPropsType = {
onCloseAdvancedModal?: (close: boolean) => void; onCloseAdvancedModal?: (close: boolean) => void;
selected: boolean; selected: boolean;
setShowState: (show: boolean | SetStateAction<boolean>) => void; setShowState: (show: boolean | SetStateAction<boolean>) => void;
updateNode: () => void;
}; };
export type parsedDataType = { export type parsedDataType = {
@ -593,7 +594,7 @@ export type chatMessagePropsType = {
updateChat: ( updateChat: (
chat: ChatMessageType, chat: ChatMessageType,
message: string, message: string,
stream_url?: string stream_url?: string,
) => void; ) => void;
}; };
@ -685,12 +686,12 @@ export type codeTabsPropsType = {
value: string, value: string,
node: NodeType, node: NodeType,
template: TemplateVariableType, template: TemplateVariableType,
tweak: tweakType tweak: tweakType,
) => string; ) => string;
buildTweakObject?: ( buildTweakObject?: (
tw: string, tw: string,
changes: string | string[] | boolean | number | Object[] | Object, changes: string | string[] | boolean | number | Object[] | Object,
template: TemplateVariableType template: TemplateVariableType,
) => Promise<string | void>; ) => Promise<string | void>;
}; };
activeTweaks?: boolean; activeTweaks?: boolean;