More efficient query results processing
This commit is contained in:
@@ -156,18 +156,19 @@ $: if ($events_trigger == 'load__event_session_obj_li' && $events_slct.event_id)
|
|||||||
|
|
||||||
$events_trigger = null;
|
$events_trigger = null;
|
||||||
|
|
||||||
if ( $ae_loc.administrator_access ) {
|
if ( $ae_loc.administrator_access || $ae_loc.trusted_access ) {
|
||||||
console.log('Administrator access search');
|
console.log('*** Administrator or Trusted Access ***');
|
||||||
handle_search__event_session($events_sess.pres_mgmt.fulltext_search_qry_str);
|
handle_search__event_session($events_sess.pres_mgmt.fulltext_search_qry_str);
|
||||||
} else if ( $ae_loc.trusted_access ) {
|
} else if ( $events_sess?.pres_mgmt.fulltext_search_qry_str.length > 2 ) {
|
||||||
console.log('Trusted access search');
|
console.log('Trusted access search');
|
||||||
handle_search__event_session($events_sess.pres_mgmt.fulltext_search_qry_str);
|
handle_search__event_session($events_sess.pres_mgmt.fulltext_search_qry_str);
|
||||||
} else if (!$events_sess.pres_mgmt.fulltext_search_qry_str || $events_sess?.pres_mgmt.fulltext_search_qry_str.length <= 1 ) {
|
} else {
|
||||||
|
console.log('*** No search string or too short ***');
|
||||||
$events_slct.event_session_obj_li = [];
|
$events_slct.event_session_obj_li = [];
|
||||||
// $events_sess.pres_mgmt.fulltext_search_qry_str = '';
|
// $events_sess.pres_mgmt.fulltext_search_qry_str = '';
|
||||||
// return false;
|
// return false;
|
||||||
} else {
|
// } else {
|
||||||
handle_search__event_session($events_sess.pres_mgmt.fulltext_search_qry_str);
|
// handle_search__event_session($events_sess.pres_mgmt.fulltext_search_qry_str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -251,9 +252,11 @@ function handle_search__event_session(search_str: string) {
|
|||||||
event_session_id_random_li = [];
|
event_session_id_random_li = [];
|
||||||
|
|
||||||
// We need to loop through the array of objects and get the event_session_id_random from each object a new list of event_session_id_randoms. Then we can use this list to get the full objects from the database.
|
// We need to loop through the array of objects and get the event_session_id_random from each object a new list of event_session_id_randoms. Then we can use this list to get the full objects from the database.
|
||||||
|
let tmp_li = []; // This is to prevent the array from constantly updating and triggering the liveQuery.
|
||||||
for (let i = 0; i < $events_slct.event_session_obj_li.length; i++) {
|
for (let i = 0; i < $events_slct.event_session_obj_li.length; i++) {
|
||||||
event_session_id_random_li.push($events_slct.event_session_obj_li[i].event_session_id_random);
|
tmp_li.push($events_slct.event_session_obj_li[i].event_session_id_random);
|
||||||
}
|
}
|
||||||
|
event_session_id_random_li = tmp_li;
|
||||||
|
|
||||||
console.log(`event_session_id_random_li:`, event_session_id_random_li);
|
console.log(`event_session_id_random_li:`, event_session_id_random_li);
|
||||||
});
|
});
|
||||||
@@ -452,8 +455,8 @@ function handle_search__event_session(search_str: string) {
|
|||||||
{/if}
|
{/if}
|
||||||
{/await}
|
{/await}
|
||||||
|
|
||||||
{#if $events_slct.event_session_obj_li?.length == event_session_id_random_li?.length && event_session_id_random_li.length == $lq_kv__event_session_obj_li?.length}
|
<!-- {#if $events_slct.event_session_obj_li?.length == event_session_id_random_li?.length && event_session_id_random_li.length == $lq_kv__event_session_obj_li?.length} -->
|
||||||
<!-- {#if $events_slct?.event_session_obj_li && $events_slct.event_session_obj_li.length > 0} -->
|
{#if $events_slct?.event_session_obj_li && $events_slct.event_session_obj_li.length > 0}
|
||||||
<section class="ae_h_scrollfix py-2 space-y-2">
|
<section class="ae_h_scrollfix py-2 space-y-2">
|
||||||
<h2 class="h3">
|
<h2 class="h3">
|
||||||
<span class="text-md">
|
<span class="text-md">
|
||||||
@@ -480,7 +483,8 @@ function handle_search__event_session(search_str: string) {
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{#each $lq_kv__event_session_obj_li as session_obj}
|
{#each $events_slct?.event_session_obj_li as session_obj}
|
||||||
|
<!-- {#each $lq_kv__event_session_obj_li as session_obj} -->
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<a
|
<a
|
||||||
|
|||||||
Reference in New Issue
Block a user