Skip to content

Commit

Permalink
fix: save instruction input
Browse files Browse the repository at this point in the history
Signed-off-by: Yulong Ruan <[email protected]>
  • Loading branch information
ruanyl committed Oct 17, 2024
1 parent 525a0b4 commit 4a5f7ef
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion public/components/visualization/text2viz.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ export const Text2Viz = () => {
}
}
if (savedVis?.uiState) {
setInputQuestion(JSON.parse(savedVis.uiState ?? '{}').input);
setInputQuestion(JSON.parse(savedVis.uiState ?? '{}').input ?? '');
setCurrentInstruction(JSON.parse(savedVis.uiState ?? '{}').instruction ?? '');
}
})
.catch(() => {
Expand Down Expand Up @@ -263,6 +264,7 @@ export const Text2Viz = () => {
});
savedVis.uiState = JSON.stringify({
input: inputQuestion,
instruction: currentInstruction,
});
savedVis.searchSourceFields = { index: indexPattern };
savedVis.title = onSaveProps.newTitle;
Expand Down Expand Up @@ -329,6 +331,7 @@ export const Text2Viz = () => {
selectedSource,
savedObjectId,
usageCollection,
currentInstruction,
]);

const pageTitle = savedObjectId
Expand Down

0 comments on commit 4a5f7ef

Please sign in to comment.