Skip to content

Commit

Permalink
removed waiting for response logic from submit func
Browse files Browse the repository at this point in the history
  • Loading branch information
ayyubibrahimi committed Nov 15, 2023
1 parent 948f42d commit eb73311
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/web/components/NewQuery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,17 +130,17 @@ export default function NewQuery() {
};
}, [card]);


const submitQuery = async (e?: React.FormEvent<HTMLFormElement>) => {
e?.preventDefault();
if (query.length <= 10) return;

const startedProcessingAt = Date.now();
setIsProcessing(true);
const newCard = await insertSupabaseCard();
const cardWResp = await sendQueryToFunction(newCard);
addMyCard(cardWResp);
};
addMyCard(newCard);
await sendQueryToFunction(newCard);
setIsProcessing(false);
setQuery("");
};

return (
<div className="my-12">
Expand Down

0 comments on commit eb73311

Please sign in to comment.