delete room when empty

This commit is contained in:
grimhilt
2023-05-06 15:58:33 +02:00
parent 1a7828b281
commit 843659b495
6 changed files with 62 additions and 28 deletions

View File

@@ -50,7 +50,11 @@ const deleteEverywhere = () => {
deletionLoading.value = true;
API.deleteEverywhere({ mailboxId: room.value?.mailboxId, messageId: props.msg?.id })
.then((res) => {
// delete even if we delete the room after because the transition between room is not clean (todo)
store.commit("removeMsg", { roomId: room.value?.id, messageId: props.msg?.id });
if (res.data?.deleteRoom) {
store.commit("removeRoom", { roomId: room.value?.id });
}
deletionLoading.value = false;
})
.catch((err) => {