maybe protecting against not leaving a conversation?
This commit is contained in:
@@ -53,8 +53,10 @@ export default function ConversationDetails() {
|
||||
useEffect(() => {
|
||||
joinConversation(selectedConversation.id, user.uid);
|
||||
|
||||
const handleCloseWindow = (event: BeforeUnloadEvent) => {
|
||||
const handleCloseWindow = (event: BeforeUnloadEvent): Promise<void> => {
|
||||
leaveConversation(selectedConversation.id, user.uid);
|
||||
|
||||
return;
|
||||
};
|
||||
|
||||
window.addEventListener('beforeunload', handleCloseWindow);
|
||||
|
||||
Reference in New Issue
Block a user