feat(mobx): migrate unreads to revolt.js

This commit is contained in:
Paul
2021-12-23 19:37:19 +00:00
parent 136238f62e
commit 6e1bcab92b
9 changed files with 117 additions and 147 deletions

View File

@@ -195,12 +195,17 @@ export default class NotificationOptions implements Store, Persistent<Data> {
* @returns Whether this object is muted
*/
isMuted(target?: Channel | Server) {
var value: NotificationState | undefined;
if (target instanceof Channel) {
return this.computeForChannel(target) === "muted";
value = this.computeForChannel(target);
} else if (target instanceof Server) {
return this.computeForServer(target._id) === "muted";
} else {
return false;
value = this.computeForServer(target._id);
}
if (value === "muted") {
return true;
}
return false;
}
}

View File

@@ -41,6 +41,7 @@ export default class ServerConfig
*/
createClient() {
const client = new Client({
unreads: true,
autoReconnect: false,
apiURL: import.meta.env.VITE_API_URL,
debug: import.meta.env.DEV,