Skip to content

Commit

Permalink
fix: prompt input
Browse files Browse the repository at this point in the history
  • Loading branch information
AykutSarac committed Mar 8, 2024
1 parent 0571924 commit 5e2657d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/PromptInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const PromptInput = () => {

if (match && match[1]) {
const extractedString = match[1];
updateJson(extractedString);
await updateJson(extractedString);
toast.success(`${data.credits} credits left for today.`);
} else {
throw Error("An error occured while parsing result.");
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useJsonQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const useJsonQuery = () => {
const updateJson = async (query: string, cb?: () => void) => {
try {
const jq = await import("jq-web");
const res = jq.json(JSON.parse(getJson()), query);
const res = await jq.promised.json(JSON.parse(getJson()), query);

setContents({ contents: JSON.stringify(res, null, 2) });
cb?.();
Expand Down

0 comments on commit 5e2657d

Please sign in to comment.