groups_settings: Fix browser back button for groups overlay.

There is no problem in behavior of browser back button if we open
the group settings overlay using "#groups/your", "#groups/all" or
"#groups/new" url hash, but someone can directly go to a link with
"#groups" and in this case we want to fix the browser back button.

This commit replaces "#groups" entry with "#groups/your" which is the
default section opened, such that pressing back when on "#groups/your"
does not go to "#groups", which will then a form a cycle and instead
go back actually.
This commit is contained in:
Sahil Batra 2024-01-18 15:45:53 +05:30
parent eced3d9d6a
commit c6be850fb9
1 changed files with 4 additions and 0 deletions

View File

@ -241,6 +241,10 @@ function do_hashchange_overlay(old_hash) {
history.replaceState(null, "", browser_history.get_full_url("streams/subscribed")); history.replaceState(null, "", browser_history.get_full_url("streams/subscribed"));
} }
if (base === "groups" && !section) {
history.replaceState(null, "", browser_history.get_full_url("groups/your"));
}
// Start by handling the specific case of going // Start by handling the specific case of going
// from something like streams/all to streams_subscribed. // from something like streams/all to streams_subscribed.
// //