Fix done detection

This commit is contained in:
Skylar Grant 2025-01-04 10:46:32 -05:00
parent 36c215b6f3
commit 57f3197a39

View File

@ -31,7 +31,7 @@ async function readResponse(response) {
reader.read().then(( chunk ) => {
console.log(`Done: ${JSON.stringify(chunk.done)}`);
console.log(`Value: ${new TextDecoder().decode(chunk.value)}`);
if (done) {
if (chunk.done) {
return;
}
read();