mirror of
https://github.com/zulip/zulip.git
synced 2026-07-09 21:21:47 +08:00
inbox_ui: Rename save and restore functions for general use.
These functions can now also be used to save and restore search text.
This commit is contained in:
parent
defd120c94
commit
6e73238ea3
@ -226,18 +226,18 @@ function save_data_to_ls(): void {
|
||||
ls.set(ls_collapsed_containers_key, [...collapsed_containers]);
|
||||
}
|
||||
|
||||
function save_channel_view_navigation_state(): void {
|
||||
function save_channel_view_state(): void {
|
||||
channel_view_navigation_state.col_focus = col_focus;
|
||||
channel_view_navigation_state.row_focus = row_focus;
|
||||
channel_view_navigation_state.channel_id = inbox_util.get_channel_id();
|
||||
}
|
||||
|
||||
function save_inbox_view_navigation_state(): void {
|
||||
function save_inbox_view_state(): void {
|
||||
inbox_view_navigation_state.col_focus = col_focus;
|
||||
inbox_view_navigation_state.row_focus = row_focus;
|
||||
}
|
||||
|
||||
function restore_channel_view_navigation_state(): void {
|
||||
function restore_channel_view_state(): void {
|
||||
if (channel_view_navigation_state.channel_id === inbox_util.get_channel_id()) {
|
||||
col_focus = channel_view_navigation_state.col_focus;
|
||||
row_focus = channel_view_navigation_state.row_focus;
|
||||
@ -249,7 +249,7 @@ function restore_channel_view_navigation_state(): void {
|
||||
row_focus = DEFAULT_ROW_FOCUS;
|
||||
}
|
||||
|
||||
function restore_inbox_view_navigation_state(): void {
|
||||
function restore_inbox_view_state(): void {
|
||||
col_focus = inbox_view_navigation_state.col_focus;
|
||||
row_focus = inbox_view_navigation_state.row_focus;
|
||||
}
|
||||
@ -280,11 +280,11 @@ export function show(filter?: Filter): void {
|
||||
return;
|
||||
}
|
||||
} else if (!was_inbox_channel_view && is_new_filter_channel_view) {
|
||||
save_inbox_view_navigation_state();
|
||||
save_inbox_view_state();
|
||||
}
|
||||
|
||||
if (was_inbox_channel_view) {
|
||||
save_channel_view_navigation_state();
|
||||
save_channel_view_state();
|
||||
}
|
||||
|
||||
// Before we set the filter, we need to check if the inbox view is already visible.
|
||||
@ -292,7 +292,7 @@ export function show(filter?: Filter): void {
|
||||
|
||||
inbox_util.set_filter(filter);
|
||||
if (inbox_util.is_channel_view()) {
|
||||
restore_channel_view_navigation_state();
|
||||
restore_channel_view_state();
|
||||
views_util.show({
|
||||
highlight_view_in_left_sidebar() {
|
||||
assert(filter !== undefined);
|
||||
@ -311,7 +311,7 @@ export function show(filter?: Filter): void {
|
||||
return;
|
||||
}
|
||||
|
||||
restore_inbox_view_navigation_state();
|
||||
restore_inbox_view_state();
|
||||
views_util.show({
|
||||
highlight_view_in_left_sidebar() {
|
||||
views_util.handle_message_view_deactivated(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user