-
Notifications
You must be signed in to change notification settings - Fork 403
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE] send warning dialog when users want to close the tab #452
Comments
It's great having you contribute to this project by creating an issueMake sure you are assigned to this before you work on it and you read the Contributing.md file, Thank you! Welcome to the community 🤓 |
Hello @Dun-sin Can you assign me this issue to me I would Like to work on this issue. |
Hello @Dun-sin can you assign me this issue . I am participating in Hacktobberfest and Hacksquad and I have implemented this type of feature on my website , so can assign this to me ! Thnks |
Okay, explain back to me what the issue is telling you to do |
Ok sure , The issue requires implementing a warning mechanism for users attempting to close the chat tab while an active conversation is ongoing. The warning dialog will inform users that closing the tab will terminate their current chat session. It will offer two options: "Back to Chat" to return to the conversation or "Leave Chat" to proceed with closing the tab. This solution aims to prevent accidental chat closures and provides users with a clear choice regarding their ongoing chat session. |
Okay, you got it. thanks for wanting to contribute. ask if you have questions. Follow the rules here, or your PR won't be accepted and will be closed. Good luck! |
Do you want , that warning dialog box appears when user clicks Close Chat button . Also , can you please tell me other buttons or times this box should be displayed , i m thinking that it would be good to show this warning sign too when user tries to logout |
your inquiry is unclear, can you repeat without quoting and trying to be clear |
@Abhishek19-dev |
Mam please give me 2 more days ... |
@Abhishek19-dev it's been 2 days, sorry you will be unassigned now |
Hello @Dun-sin. The problem is whenever before unload event is called the default prompt is shown which says changes you made are not saved and if you want to leave. I tried disabling the default behavior but it doesnt go. So if we have to show only this then issue is solved but if we have to call our custom dialog we cant call window.close() on yes click because of browser restriction. We can only close tabs which are opened by window.open(). So what do you suggest. |
hmm, let me try to understand what you are saying here, you are saying we can't present tab close? What browser are you testing that on? and also can i see the code of how you tried to do it? just a short snippet |
The issue has been unlocked and is now ready for dev. If you would like to work on this issue, you can comment to have it assigned to you. |
Hi @Dun-sin i want to work on this please assign it to me. will finish in a day. |
How do you plan to finish it in a day and how would you solve the issue? |
Hi, Is this issue still open |
@DanonymousCoder how do you plan to solve the issue based on what was discussed previously? |
@Dun-sin I would listen for the beforeunload event and display a warning message but i can't customize the dialog fully due to browser security restrictions, but i can display a default message. |
no, read the previous conversation in this issue, there was a problem they couldn't fix, i'm asking how would you make it work if they couldn't |
@Dun-sin I would use local or session storage to save and restore chat state. Then, I would display a custom warning before unload(but while i can't fully customize the browser's built-in dialog due to security restrictions, i can still inform the user that they will lose the chat state unless they confirm they want to leave) and for other navigation actions like clicking on links within the chat, i can use custom js to intercept the event, show a custom dialog, and confirm the user's intention to navigate away. |
Sounds good, quick things to note:
Will assign it to you, follow the rules in the contributing file as usual, good luck |
@Dun-sin Hi, can you please kindly unassign me this task. I'll be unable to do it |
@Dun-sin so if i understand correctly we need a warning dialog to the BuddyMatcher component that triggers when a user attempts to close the tab with an active chat. this is my implementation i dont know if you are happy with that . Take a look
|
@tasosbeast it doesn't have to be on the BuddyMatcher, becareful about using AI as well, make sure you provide it the right context, i don't/can't know if that code works till you raise a PR |
Description
There may be cases where users want to close the tab while they are currently chatting, here's what you need to do:
Screenshots
No response
Additional information
No response
👀 Have you checked if this issue has been raised before?
🏢 Have you read the Contributing Guidelines?
Are you willing to work on this issue ?
None
The text was updated successfully, but these errors were encountered: