stream-settings: Fix browser back button behavior for stream settings overlay.

There is no problem in behavior of browser back button we open stream settings
overlay using UI elements since they are appropriately linked to "#streams/all",
"#streams/subscribed" and "#streams/new", but someone can directly go to a
link with "#streams" and in this case we want to fix the browser back button.

This commit replaces "#streams" entry with "#streams/subscribed" which is the
default section opened, such that pressing back when on "#streams/subscribed"
does not go to "#streams" and instead go back actually.
This commit is contained in:
Sahil Batra 2022-02-08 16:37:40 +05:30 committed by Tim Abbott
parent 9501dd0f94
commit 7a2bbc54a8
1 changed files with 4 additions and 0 deletions

View File

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