update and fix messanger
This commit is contained in:
12
apps/frontend/lib/avatar-events.ts
Normal file
12
apps/frontend/lib/avatar-events.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
export const AVATAR_UPDATED_EVENT = 'id:avatar-updated';
|
||||
export const CHAT_ROOM_AVATAR_UPDATED_EVENT = 'id:chat-room-avatar-updated';
|
||||
|
||||
export function dispatchAvatarUpdated(userId: string) {
|
||||
if (typeof window === 'undefined') return;
|
||||
window.dispatchEvent(new CustomEvent(AVATAR_UPDATED_EVENT, { detail: { userId } }));
|
||||
}
|
||||
|
||||
export function dispatchChatRoomAvatarUpdated(roomId: string) {
|
||||
if (typeof window === 'undefined') return;
|
||||
window.dispatchEvent(new CustomEvent(CHAT_ROOM_AVATAR_UPDATED_EVENT, { detail: { roomId } }));
|
||||
}
|
||||
Reference in New Issue
Block a user