fix mailbox update
This commit is contained in:
Vendored
+6
@@ -617,6 +617,11 @@
|
|||||||
function deleteMailbox() {
|
function deleteMailbox() {
|
||||||
UDN.deleteMailbox(mailboxId.value);
|
UDN.deleteMailbox(mailboxId.value);
|
||||||
}
|
}
|
||||||
|
function updateMailbox() {
|
||||||
|
if (!isMailboxConnected || mailboxId.value == "") return;
|
||||||
|
deleteMailbox();
|
||||||
|
requestMailbox();
|
||||||
|
}
|
||||||
async function sendMessage() {
|
async function sendMessage() {
|
||||||
if (cannotSendMessage.value == true) return;
|
if (cannotSendMessage.value == true) return;
|
||||||
const secondaryChannelNames = [
|
const secondaryChannelNames = [
|
||||||
@@ -651,6 +656,7 @@
|
|||||||
UDN.unsubscribe(currentPrimaryChannel.value);
|
UDN.unsubscribe(currentPrimaryChannel.value);
|
||||||
}
|
}
|
||||||
UDN.subscribe(primaryChannel.value);
|
UDN.subscribe(primaryChannel.value);
|
||||||
|
updateMailbox();
|
||||||
}
|
}
|
||||||
function leaveChannel() {
|
function leaveChannel() {
|
||||||
if (cannotLeaveChannel.value == true) return;
|
if (cannotLeaveChannel.value == true) return;
|
||||||
|
|||||||
+4
-3
@@ -146,7 +146,8 @@ export function deleteMailbox(): void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function updateMailbox(): void {
|
export function updateMailbox(): void {
|
||||||
if (!isMailboxConnected) return;
|
if (!isMailboxConnected || mailboxId.value == "") return;
|
||||||
|
|
||||||
deleteMailbox();
|
deleteMailbox();
|
||||||
requestMailbox();
|
requestMailbox();
|
||||||
}
|
}
|
||||||
@@ -201,7 +202,7 @@ export function setChannel(): void {
|
|||||||
UDN.unsubscribe(currentPrimaryChannel.value);
|
UDN.unsubscribe(currentPrimaryChannel.value);
|
||||||
}
|
}
|
||||||
UDN.subscribe(primaryChannel.value);
|
UDN.subscribe(primaryChannel.value);
|
||||||
|
|
||||||
updateMailbox();
|
updateMailbox();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -239,7 +240,7 @@ UDN.onconnect = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
UDN.onmailboxcreate = (id) => {
|
UDN.onmailboxcreate = (id) => {
|
||||||
mailboxId.value = id;
|
mailboxId.value = id;
|
||||||
UDN.connectMailbox(id);
|
UDN.connectMailbox(id);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user