Bug 33484: Do not consider we loaded from state if search was not saved

The loaded_from_state flag is used to know if we defer the loading of
the table or not.
We should not display the result (ie not defer loading) if only the
configuration has been retrieved from localStorage.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Jonathan Druart 2024-10-24 10:44:40 +02:00 committed by Katrin Fischer
parent c71e123c4d
commit f4f231f103
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
2 changed files with 6 additions and 4 deletions

View File

@ -54,11 +54,12 @@ function KohaTable(id_selector, dt_parameters, table_settings, add_filters) {
state = JSON.parse(state);
if (!default_save_state_search ) {
if (default_save_state_search ) {
settings.loaded_from_state = true;
} else {
delete state.search;
state.columns.forEach(c => delete c.search );
}
settings.loaded_from_state = true;
return state;
}

View File

@ -999,11 +999,12 @@ function _dt_save_restore_state(table_settings, external_filter_nodes={}){
state = JSON.parse(state);
if (!default_save_state_search ) {
if (default_save_state_search ) {
settings.loaded_from_state = true;
} else {
delete state.search;
state.columns.forEach(c => delete c.search );
}
settings.loaded_from_state = true;
return state;
}