mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 23:13:25 +00:00
ui_init: Restore guard against direct use of page_params.state_data.
Before commit fd253539e0 (#30519), each
part of state_data was removed by pop_fields, to ensure that it was
only used by its associated module and not manipulated directly.
Restore this guarantee by removing page_params.state_data itself.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
3a7f5da717
commit
95a2ce6ed6
@@ -670,7 +670,7 @@ export function initialize_everything(state_data) {
|
||||
$("#app-loading").addClass("loaded");
|
||||
}
|
||||
|
||||
$(async () => {
|
||||
$(() => {
|
||||
if (page_params.is_spectator) {
|
||||
const data = {
|
||||
apply_markdown: true,
|
||||
@@ -699,7 +699,9 @@ $(async () => {
|
||||
},
|
||||
});
|
||||
} else {
|
||||
assert(page_params.state_data !== undefined);
|
||||
initialize_everything(page_params.state_data);
|
||||
const state_data = page_params.state_data;
|
||||
assert(state_data !== null);
|
||||
page_params.state_data = null;
|
||||
initialize_everything(state_data);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user