Skip to content

Commit 150e976

Browse files
Fixed Issue when no messages exists it got stucked in loading screen
1 parent 5688282 commit 150e976

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

server.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,15 @@ async def websocket_endpoint(websocket: WebSocket):
5454
rows = cursor.fetchall()
5555

5656
for name, text in reversed(rows):
57-
await websocket.send_text(json.dumps({
58-
"name": name,
59-
"text": text
60-
}))
57+
await websocket.send_text(json.dumps({
58+
"name": name,
59+
"text": text
60+
}))
61+
62+
# tell client history is finished
63+
await websocket.send_text(json.dumps({
64+
"type": "history_end"
65+
}))
6166

6267
try:
6368

0 commit comments

Comments
 (0)