Display the correct window on page reload

This commit packs 2 fixes:

- Reloading the page while viewing the settings or help window would now send you to a channel window. This was broken when fixing an issue with the "Join a channel..." form
- Reloading the page while viewing the changelog would also send you to a channel window. This is because, on reload, the click emitted was restricted to sidebar and footer, while it had to be emitted from the help page. It is yet another aspect of our wonky window management and hopefully we can make this much more robust with a better overall solution.
This commit is contained in:
Jérémie Astori 2017-12-23 20:46:43 -05:00
parent 7c2422ee19
commit d1c2f0df72
No known key found for this signature in database
GPG key ID: B9A4F245CD67BDE8

View file

@ -64,7 +64,8 @@ function openCorrectChannel(clientActive, serverActive) {
// Open window provided in location.hash
if (target.length === 0 && window.location.hash) {
target = $("#footer, #sidebar").find(`.chan[data-target="${escape(window.location.hash)}"]`);
target = $("#footer, #sidebar, #help")
.find(`[data-target="${escape(window.location.hash)}"]`);
}
// Open last active channel according to the server