diff options
| author | Dhravya <[email protected]> | 2024-04-09 19:19:30 -0700 |
|---|---|---|
| committer | Dhravya <[email protected]> | 2024-04-09 19:19:30 -0700 |
| commit | 2df0c73bea1dd863e9368cd88284485a4e816841 (patch) | |
| tree | 1f6d47472b2cd1b424e82814c9eb4f34d4063104 /apps/extension/src | |
| parent | new-ui WORKS AND DONE AND DUSTED (diff) | |
| download | supermemory-2df0c73bea1dd863e9368cd88284485a4e816841.tar.xz supermemory-2df0c73bea1dd863e9368cd88284485a4e816841.zip | |
fix malformed data sometimes
Diffstat (limited to 'apps/extension/src')
| -rw-r--r-- | apps/extension/src/SideBar.tsx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/apps/extension/src/SideBar.tsx b/apps/extension/src/SideBar.tsx index babe0bc1..96b1dd4c 100644 --- a/apps/extension/src/SideBar.tsx +++ b/apps/extension/src/SideBar.tsx @@ -79,6 +79,9 @@ function SideBar({ jwt }: { jwt: string }) { // Process each part to extract JSON objects parts.forEach((part, index) => { + if (part.startsWith('data: [DONE]data: ')) { + part = part.replace('data: [DONE]data: ', 'data: '); + } try { const parsedPart = JSON.parse(part.replace('data: ', '')); // Try to parse the part as JSON |