streamed messages
This commit is contained in:
1 parent
f2a6fc0cd5
commit
7114d91403
7 files changed
+107
-34
No files matched your search
@@ -76,6 +76,18 @@
|
||||
});
|
||||
|
||||
unsubscribeChat = backend.onChatMessages(chatId, it => {
|
||||
if (it.update) {
|
||||
// Find message in list. If not found, add it
|
||||
for (let entry of messages.value) {
|
||||
if (entry.id == it.id) {
|
||||
entry.type = it.kind;
|
||||
entry.content = it.content;
|
||||
entry.threadId = it.threadId;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (it.sender == 'user') {
|
||||
let unsent = unsentMessages.value.shift();
|
||||
if (unsent) {
|
||||
@@ -85,7 +97,7 @@
|
||||
return;
|
||||
} else {
|
||||
// Remove from unsent list and add message as received
|
||||
ui.alert("Unsent messages received differently");
|
||||
ui.alert("TODO: update unsent message");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user