fix: prompt input

This commit is contained in:
AykutSarac 2024-03-08 10:14:54 +03:00
parent 0571924dc1
commit 5e2657d742
No known key found for this signature in database
2 changed files with 2 additions and 2 deletions

View File

@ -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.");

View File

@ -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?.();