Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a2ce907480 | ||
|
|
e4631e7486 |
@@ -1,12 +1,13 @@
|
||||
<script lang="ts">
|
||||
import { untrack } from 'svelte';
|
||||
import { goto } from '$app/navigation';
|
||||
import { audioStore } from '$lib/audio.svelte';
|
||||
import type { PageData } from './$types';
|
||||
|
||||
let { data }: { data: PageData } = $props();
|
||||
|
||||
let q = $state(data.q);
|
||||
let sort = $state(data.sort);
|
||||
let q = $state(untrack(() => data.q));
|
||||
let sort = $state(untrack(() => data.sort));
|
||||
|
||||
function parseGenres(genres: string[] | string | null | undefined): string[] {
|
||||
if (!genres) return [];
|
||||
@@ -35,8 +36,8 @@
|
||||
list = [...list].sort((a, b) => (a.book.title ?? '').localeCompare(b.book.title ?? ''));
|
||||
} else if (sort === 'recent') {
|
||||
list = [...list].sort((a, b) => {
|
||||
const da = a.book.updated ?? a.book.created ?? '';
|
||||
const db = b.book.updated ?? b.book.created ?? '';
|
||||
const da = a.book.meta_updated ?? '';
|
||||
const db = b.book.meta_updated ?? '';
|
||||
return db.localeCompare(da);
|
||||
});
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user