maybe protecting against not leaving a conversation?

This commit is contained in:
talksik
2022-05-30 11:43:41 -05:00
parent bc4b26dd1f
commit 96c1aafd8c
2 changed files with 5 additions and 29 deletions
@@ -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);