From b2b11dca5db4f92542d348b38f96d68642c0ec94 Mon Sep 17 00:00:00 2001 From: Abdurrahman Rajab Date: Thu, 16 Nov 2023 16:50:33 +0300 Subject: [PATCH] chore: format and lint the code --- src/repo-query/pages/chat.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/repo-query/pages/chat.tsx b/src/repo-query/pages/chat.tsx index 96bdbd1..7717bc4 100644 --- a/src/repo-query/pages/chat.tsx +++ b/src/repo-query/pages/chat.tsx @@ -18,7 +18,7 @@ export const Chat = ({ ownerName, repoName }: { ownerName: string, repoName: str const processChunk = (chunk: string) => { const chunkLines = chunk.split("\n"); - const indexOfEvent = chunkLines.findIndex((e) => e.includes("event: ")) + const indexOfEvent = chunkLines.findIndex(e => e.includes("event: ")); const [eventLine, dataLine] = [chunkLines[indexOfEvent], chunkLines[indexOfEvent + 1]]; const event = eventLine.split(": ")[1]; @@ -28,6 +28,7 @@ export const Chat = ({ ownerName, repoName }: { ownerName: string, repoName: str data = JSON.parse(dataLine.split(": ")[1]); } catch (e) { console.error("The recieved data line", dataLine); + // remove quotes from string data = dataLine.split("data: ")[1].substring(1, dataLine.split("data: ")[1].length - 2); }