perf(api,frontend): index hot queries, paginate chats, fix realtime
This commit is contained in:
1 parent
9d767d2531
commit
525ce024bc
27 files changed
+831
-268
No files matched your search
@@ -9,6 +9,7 @@
|
||||
import JobList from "$lib/components/jobs/JobList.svelte";
|
||||
import Button from "$lib/components/ui/Button.svelte";
|
||||
import Icon from "$lib/components/ui/Icon.svelte";
|
||||
import { createChatPicker } from "$lib/stores/chat-picker.svelte";
|
||||
import { chats } from "$lib/stores/chats.svelte";
|
||||
import { toasts } from "$lib/stores/toasts.svelte";
|
||||
|
||||
@@ -23,13 +24,18 @@
|
||||
let syncing = $state(false);
|
||||
let syncingContacts = $state(false);
|
||||
|
||||
const availableChats = $derived(
|
||||
chats.list
|
||||
.filter((c) =>
|
||||
(c.title ?? "").toLowerCase().includes(filter.trim().toLowerCase())
|
||||
)
|
||||
.slice(0, 40)
|
||||
);
|
||||
const picker = createChatPicker();
|
||||
const availableChats = $derived(picker.results);
|
||||
|
||||
$effect(() => {
|
||||
picker.search(filter);
|
||||
});
|
||||
|
||||
$effect(() => {
|
||||
if (selected !== null) {
|
||||
chats.ensure(selected);
|
||||
}
|
||||
});
|
||||
|
||||
function chatTitle(id: number | null): string {
|
||||
if (id === null) {
|
||||
|
||||
Reference in new issue
Block a user