refactor: handling single websocket that handles all rooms the user is in, and added (not persistent) unread message count
This commit is contained in:
@@ -48,7 +48,3 @@ export async function uploadAvatar(
|
||||
xhr.send(fileData);
|
||||
});
|
||||
}
|
||||
|
||||
export function getAvatar(uuid: string): string {
|
||||
return `${API}/account/get-avatar/${uuid}`;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user