nonblocking send loop (#344)

This commit is contained in:
BlowaterNostr 2023-12-05 02:14:26 +08:00 committed by GitHub
parent 253958579e
commit 7948a294c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -183,7 +183,7 @@ export async function* UI_Interaction_Update(args: {
// Editor
//
else if (event.type == "SendMessage") {
const err = await handle_SendMessage(
handle_SendMessage(
event,
app.ctx,
app.lamport,
@ -192,11 +192,11 @@ export async function* UI_Interaction_Update(args: {
app.model.gmEditors,
app.database,
app.groupChatController,
);
if (err instanceof Error) {
console.error("update:SendMessage", err);
continue;
}
).then((res) => {
if (res instanceof Error) {
console.error("update:SendMessage", res);
}
});
} else if (event.type == "UpdateMessageFiles") {
const editors = event.isGroupChat ? model.gmEditors : model.dmEditors;
const editor = editors.get(event.pubkey.hex);