From 7cef6b6526289ec590847128c71a6bf28a7a9ee0 Mon Sep 17 00:00:00 2001 From: Deep Nayak Date: Wed, 18 Sep 2024 18:41:36 +0530 Subject: [PATCH] Fix sourcery issues --- ui/src/app/[id]/page.tsx | 15 +++++++-------- ui/src/app/page.tsx | 19 ++++++++++--------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/ui/src/app/[id]/page.tsx b/ui/src/app/[id]/page.tsx index 479348f..617ccac 100644 --- a/ui/src/app/[id]/page.tsx +++ b/ui/src/app/[id]/page.tsx @@ -136,7 +136,9 @@ export default function Page({ params }: { params: { id: string } }) { if (reader) { while (true) { const { done, value } = await reader.read() - if (done) break + if (done) { + break + } let temp = new TextDecoder().decode(value); let currentState = JSON.parse(temp) if (currentState['error']) { @@ -181,14 +183,11 @@ export default function Page({ params }: { params: { id: string } }) { console.log(input) if (input.startsWith("#goat")) { runGoatPipeline() + } else if (env === "production") { + handleSubmitProduction(e); } else { - // handleSubmitProduction(e); - if (env === "production") { - handleSubmitProduction(e); - } else { - // Call the handleSubmit function with the options - handleSubmit(e, requestOptions); - } + // Call the handleSubmit function with the options + handleSubmit(e, requestOptions); } }; diff --git a/ui/src/app/page.tsx b/ui/src/app/page.tsx index 90e07a7..e7d9b39 100644 --- a/ui/src/app/page.tsx +++ b/ui/src/app/page.tsx @@ -112,7 +112,9 @@ export default function Home() { if (reader) { while (true) { const { done, value } = await reader.read() - if (done) break + if (done) { + break + } let temp = new TextDecoder().decode(value); let currentState = JSON.parse(temp) if (currentState['error']) { @@ -204,21 +206,20 @@ export default function Home() { console.log(input) if (input.startsWith("#goat")) { runGoatPipeline() + } else if (env === "production") { + handleSubmitProduction(e); } else { - // handleSubmitProduction(e); - if (env === "production") { - handleSubmitProduction(e); - } else { - // Call the handleSubmit function with the options - handleSubmit(e, requestOptions); - } + // Call the handleSubmit function with the options + handleSubmit(e, requestOptions); } }; const onOpenChange = (isOpen: boolean) => { const username = localStorage.getItem("ollama_user") - if (username) return setOpen(isOpen) + if (username) { + return setOpen(isOpen) + } localStorage.setItem("ollama_user", "Anonymous") window.dispatchEvent(new Event("storage"))