Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
lloydzhou committed Sep 30, 2024
1 parent 6293b95 commit b6d9ba9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src-tauri/src/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,18 @@ pub async fn stream_fetch(
match chunk {
Ok(bytes) => {
// println!("chunk: {:?}", bytes);
window.emit(event_name, ChunkPayload{ request_id, chunk: bytes }).unwrap();
if let Err(e) = window.emit(event_name, ChunkPayload{ request_id, chunk: bytes }) {
println!("Failed to emit chunk payload: {:?}", e);
}
}
Err(err) => {
println!("Error chunk: {:?}", err);
}
}
}
window.emit(event_name, EndPayload { request_id, status: 0 }).unwrap();
if let Err(e) = window.emit(event_name, EndPayload{ request_id, status: 0 }) {
println!("Failed to emit end payload: {:?}", e);
}
});

StreamResponse {
Expand Down

0 comments on commit b6d9ba9

Please sign in to comment.