stream settings: Fix initialization of main toggler state.

The "Stream settings" UI was always intended to be initialized in the
"Subscribed" tab when opened not through navigation that explicitly
aims to via "All streams".  We had implemented that through how the UI
is rendered as well as the internal state tracking variable
`subscribed_only`, which was initialized to `true`.

The bug was that we didn't reset that to `true` when re-opening
"Stream settings" via a code path that calls `setup_page` (e.g. via
the menus on the left sidebar).

Ths fixes a bug where the stream-list in the stream settings would
list all streams but would show the 'Subscribed' label after
navigating to "All streams", closing "Manage streams", and then
reopening it.

Fixes #13297.
This commit is contained in:
joaomcarvalho
2019-12-01 18:04:53 -03:00
committed by Tim Abbott
parent a26b379a14
commit cd2c68c778

View File

@@ -506,6 +506,9 @@ exports.setup_page = function (callback) {
// continue the strategy that we re-render everything from scratch.
// Also, we'll always go back to the "Subscribed" tab.
function initialize_components() {
// Reset our internal state to reflect that we're initially in
// the "Subscribed" tab if we're reopening "Manage streams".
subscribed_only = true;
exports.toggler = components.toggle({
child_wants_focus: true,
values: [