refactor: handling single websocket that handles all rooms the user is in, and added (not persistent) unread message count

This commit is contained in:
2026-01-16 11:36:09 +01:00
parent 7e2bf22e7b
commit f82a93e81e
8 changed files with 157 additions and 89 deletions

View File

@@ -48,7 +48,3 @@ export async function uploadAvatar(
xhr.send(fileData);
});
}
export function getAvatar(uuid: string): string {
return `${API}/account/get-avatar/${uuid}`;
}

View File

@@ -19,7 +19,7 @@ export function sendMessage(roomUuid: string, content: string) {
})
}
export async function getWsToken(roomUuid: string): Promise<string> {
const data = await apiFetch<{ token: string }>(`/ws/issue-token/rooms/${roomUuid}`);
return data.token;
export async function getWsToken(): Promise<string> {
const res = await apiFetch<{ token: string }>(`/ws/messages/issue-token`);
return res.token;
}