Context Menus: Add "mark as unread" back.

Servers: Fix various issues relating to voice channels.
This commit is contained in:
Paul
2021-06-24 13:07:55 +01:00
parent eef3e11e62
commit 352c0e880c
7 changed files with 40 additions and 23 deletions

View File

@@ -104,6 +104,16 @@ export function registerEvents({
client.addListener(listener, (listenerFunc as any)[listener]);
}
function logMutation(target: string, key: string) {
console.log('(o) Object mutated', target, '\nChanged:', key);
}
if (import.meta.env.DEV) {
client.users.addListener('mutation', logMutation);
client.servers.addListener('mutation', logMutation);
client.channels.addListener('mutation', logMutation);
}
const online = () => {
if (operations.ready()) {
setStatus(ClientStatus.RECONNECTING);
@@ -128,6 +138,12 @@ export function registerEvents({
client.removeListener(listener, (listenerFunc as any)[listener]);
}
if (import.meta.env.DEV) {
client.users.removeListener('mutation', logMutation);
client.servers.removeListener('mutation', logMutation);
client.channels.removeListener('mutation', logMutation);
}
window.removeEventListener("online", online);
window.removeEventListener("offline", offline);
};