fix mailbox update

This commit is contained in:
marlon-erler
2024-07-09 03:32:22 +02:00
parent bed2a6bffe
commit 031cfb0ad3
2 changed files with 10 additions and 3 deletions
+6
View File
@@ -617,6 +617,11 @@
function deleteMailbox() {
UDN.deleteMailbox(mailboxId.value);
}
function updateMailbox() {
if (!isMailboxConnected || mailboxId.value == "") return;
deleteMailbox();
requestMailbox();
}
async function sendMessage() {
if (cannotSendMessage.value == true) return;
const secondaryChannelNames = [
@@ -651,6 +656,7 @@
UDN.unsubscribe(currentPrimaryChannel.value);
}
UDN.subscribe(primaryChannel.value);
updateMailbox();
}
function leaveChannel() {
if (cannotLeaveChannel.value == true) return;
+4 -3
View File
@@ -146,7 +146,8 @@ export function deleteMailbox(): void {
}
export function updateMailbox(): void {
if (!isMailboxConnected) return;
if (!isMailboxConnected || mailboxId.value == "") return;
deleteMailbox();
requestMailbox();
}
@@ -201,7 +202,7 @@ export function setChannel(): void {
UDN.unsubscribe(currentPrimaryChannel.value);
}
UDN.subscribe(primaryChannel.value);
updateMailbox();
}
@@ -239,7 +240,7 @@ UDN.onconnect = () => {
}
};
UDN.onmailboxcreate = (id) => {
UDN.onmailboxcreate = (id) => {
mailboxId.value = id;
UDN.connectMailbox(id);
};