The archives are looking better now. Mostly style and sorting improvements.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
/** @type {import('./$types').PageData} */
|
||||
export let data: any;
|
||||
let log_lvl = 0;
|
||||
let log_lvl = 1;
|
||||
|
||||
// Imports
|
||||
import { Modal } from 'flowbite-svelte';
|
||||
@@ -55,14 +55,30 @@ $: lq__archive_obj = liveQuery(async () => {
|
||||
});
|
||||
|
||||
$: lq__archive_content_obj_li = liveQuery(async () => {
|
||||
let results = await db_archives.content
|
||||
.where('archive_id')
|
||||
.equals($idaa_slct?.archive_id ?? '') // null or undefined does not reset things like '' does
|
||||
.reverse()
|
||||
.sortBy('updated_on');
|
||||
// .sortBy('title');
|
||||
if (log_lvl) {
|
||||
console.log(`$lq__archive_obj.cfg_json = `, $lq__archive_obj?.cfg_json);
|
||||
}
|
||||
if ($lq__archive_obj?.cfg_json?.content_group_sort === 'DESC') {
|
||||
let results = await db_archives.content
|
||||
// .orderBy('updated_on')
|
||||
.where('archive_id')
|
||||
.equals($idaa_slct?.archive_id ?? '') // null or undefined does not reset things like '' does
|
||||
.reverse()
|
||||
.sortBy('tmp_sort_2');
|
||||
// .sortBy('updated_on');
|
||||
// .sortBy('title');
|
||||
|
||||
return results;
|
||||
} else {
|
||||
let results = await db_archives.content
|
||||
.where('archive_id')
|
||||
.equals($idaa_slct?.archive_id ?? '') // null or undefined does not reset things like '' does
|
||||
// .reverse()
|
||||
.sortBy('tmp_sort_2');
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
return results;
|
||||
});
|
||||
|
||||
$: lq__archive_content_obj = liveQuery(async () => {
|
||||
|
||||
Reference in New Issue
Block a user