fix bug with mailbox

This commit is contained in:
marlon-erler
2024-07-09 04:00:59 +02:00
parent 885ec3f553
commit b613bb9450
2 changed files with 12 additions and 6 deletions
+6 -3
View File
@@ -650,13 +650,15 @@
function deleteMessage(message) {
messages.remove(message);
}
function setChannel() {
function setChannel(shouldUpdateMailbox = true) {
if (cannotSetChannel.value == true) return;
if (currentPrimaryChannel != void 0) {
UDN.unsubscribe(currentPrimaryChannel.value);
}
UDN.subscribe(primaryChannel.value);
updateMailbox();
if (shouldUpdateMailbox) {
updateMailbox();
}
}
function leaveChannel() {
if (cannotLeaveChannel.value == true) return;
@@ -677,7 +679,7 @@
}
UDN.onconnect = () => {
isConnected.value = true;
setChannel();
setChannel(false);
if (mailboxId.value != "") {
UDN.connectMailbox(mailboxId.value);
}
@@ -687,6 +689,7 @@
UDN.connectMailbox(id);
};
UDN.onmailboxconnect = () => {
console.log("connected");
isMailboxConnected.value = true;
};
UDN.onmailboxdelete = () => {