update mailbox when chat channel changes
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import * as React from "bloatless-react";
|
||||
|
||||
import { UDN, chatIds, chats, isConnected, senderName } from "../Model/model";
|
||||
import { UDN, chatIds, chats, isConnected, senderName, updateMailbox } from "../Model/model";
|
||||
import { decryptString, encryptString } from "../cryptUtility";
|
||||
|
||||
import { Message } from "udn-frontend";
|
||||
@@ -185,6 +185,7 @@ export class Chat {
|
||||
if (this.cannotSetChannel.value == true) return;
|
||||
this.primaryChannel.value = this.primaryChannelInput.value;
|
||||
UDN.subscribe(this.primaryChannel.value);
|
||||
updateMailbox();
|
||||
};
|
||||
|
||||
undoChannelChange = (): void => {
|
||||
@@ -213,4 +214,5 @@ export function createChatWithName(name: string): void {
|
||||
chatIds.add(newChat.id);
|
||||
|
||||
UDN.subscribe(name);
|
||||
updateMailbox();
|
||||
}
|
||||
|
||||
+3
-2
@@ -15,7 +15,8 @@ export const didRequestConnection = React.restoreState(
|
||||
false
|
||||
);
|
||||
export const currentAddress = React.restoreState("current-address", "");
|
||||
export const previousAddresses = React.restoreListState<string>("previous-addresses")
|
||||
export const previousAddresses =
|
||||
React.restoreListState<string>("previous-addresses");
|
||||
|
||||
export const cannotDisonnect = React.createProxyState(
|
||||
[isConnected],
|
||||
@@ -106,7 +107,7 @@ export function deleteMailbox(): void {
|
||||
|
||||
export function updateMailbox(): void {
|
||||
deleteMailbox();
|
||||
updateMailbox();
|
||||
setTimeout(() => requestMailbox(), 10);
|
||||
}
|
||||
|
||||
UDN.onmailboxcreate = (id) => {
|
||||
|
||||
Reference in New Issue
Block a user