Closed AdityaHirapara closed 6 years ago
Rather than a confirmation modal, shouldn't it remain on the same chat if the user reloads? In case user navigates back or so then it's required to a show an alert.
To keep the user on the same page, we need to store the messages, right? Because we aren't using any backend stuff here, we need to figure out something.
On Mar 30, 2018 7:41 PM, "Ajay NS" notifications@github.com wrote:
Rather than a confirmation modal, shouldn't it remain on the same chat if the user reloads? In case user navigates back or so then it's required to a show an alert.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/wdlsvnit/Omeclone/issues/124#issuecomment-377532634, or mute the thread https://github.com/notifications/unsubscribe-auth/ARGGJal2ZMnL4P_y98BB2-yzGIScN7z-ks5tjj0sgaJpZM4SpG0Y .
Storing messages is not a good option. So I'd say we'll just have to go with an alert in case the user decides to do any navigation at all or hits refresh.
@AdityaHirapara The window.onbeforeunload
event can be used to define a function with calls when user. I'm not sure about browser compatibility though.
@ajayns windows.onbeforeunload
is not even compatible with chrome, So we can't use it.
We discussed it yesterday too. We haven't implemented just because of browser compatibility. If we want to implement the form resubmission like thing, then we need to change the bottom input to form. Aditya we tried form thing too. Right? What was the problem with that?
On Mar 30, 2018 10:03 PM, "Aditya Hirapara" notifications@github.com wrote:
@ajayns https://github.com/ajayns windows.onbeforeunload is not even compatible with chrome, So we can't use it.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/wdlsvnit/Omeclone/issues/124#issuecomment-377564509, or mute the thread https://github.com/notifications/unsubscribe-auth/ARGGJQcCTW5GpeikxckPjWYqQZBwiHNiks5tjl53gaJpZM4SpG0Y .
@sumedh123 In form, when we send message, it will reload page and chat will end.
we can prevent the default action right? @AdityaHirapa.
@sumedh123, Then it will prevent that "resubmission" alert too
@AdityaHirapara preventDefault()
does that?
And chrome for me seems to show "Do you want to leave this site" irrespective of return message we put in the function. Isn't that fine for now? (Talking about onbeforeload
here)
Yeah we need a MVP(Minimum viable product) for now.
For now, it's better to have something than nothing. Let's implement the discussed one then.
Current behaviour Chat ends without confirmation when user reloads page.
Expected behaviour Confirmation modal should be shown on reloading of page.