remove deleted objects from outbox

This commit is contained in:
marlon-erler
2024-07-11 02:15:02 +02:00
parent fbed8f8780
commit cf935b400a
3 changed files with 13 additions and 5 deletions
+10 -4
View File
@@ -595,16 +595,22 @@
const messageString = JSON.stringify(chatMessage);
UDN.sendMessage(chatMessage.channel, messageString);
this.outbox.remove(chatMessage);
if (chatMessage.messageObject)
this.objectOutbox.remove(chatMessage.messageObject.id);
};
// objects
async addObjectAndSend(object) {
addObjectAndSend(object) {
this.objects.set(object.id, object);
await this.sendObject(object);
this.sendObject(object);
}
async sendObject(object) {
sendObject(object) {
this.objectOutbox.set(object.id, object);
this.sendMessagesInOutbox();
}
deleteObject(object) {
this.objects.remove(object.id);
this.objectOutbox.remove(object.id);
}
// channel
setChannel = () => {
if (this.cannotSetChannel.value == true) return;
@@ -1133,7 +1139,7 @@
closeModal();
}
function deleteAndClose() {
chat.objects.remove(object.id);
chat.deleteObject(object);
closeModal();
}
const editingTitle = new State(object.title);