This commit is contained in:
Nell committed 2026-08-29 18:58:13 +02:00
1 parent 9551e90678
commit f2197a6b28
7 files changed
+214 -73

No files matched your search

+17
View File
@@ -168,3 +168,20 @@ onGatewayEvent("Category", (payload) => {
void useServerStore().fetchServerTree(category.server_id);
}
});
onGatewayEvent("ServerTree", (payload) => {
if (payload.action !== "refresh") return;
const serverId = String(payload.content);
if (serverId) void useServerStore().fetchServerTree(serverId);
});
onGatewayEvent("Server", (payload) => {
if (payload.action !== "update") return;
const updated = payload.content as Server;
const store = useServerStore();
const index = store.servers.findIndex(server => server.id === updated.id);
if (index >= 0) {
updated.unread_count ??= store.servers[index].unread_count ?? 0;
store.servers[index] = updated;
}
});