feat(api,userbot,frontend): search peers without chats and start tracking them

This commit is contained in:
hh committed 2026-08-05 23:46:54 +02:00
1 parent dcf95bd9d4
commit 92fd20137e
21 files changed
+936 -65

No files matched your search

@@ -1,7 +1,11 @@
<script lang="ts">
import { onMount } from "svelte";
import { page } from "$app/state";
import { enqueueBackfill, syncDialogs } from "$lib/api/endpoints";
import {
enqueueBackfill,
syncContacts,
syncDialogs,
} from "$lib/api/endpoints";
import JobList from "$lib/components/jobs/JobList.svelte";
import Button from "$lib/components/ui/Button.svelte";
import Icon from "$lib/components/ui/Icon.svelte";
@@ -17,6 +21,7 @@
let filter = $state("");
let starting = $state(false);
let syncing = $state(false);
let syncingContacts = $state(false);
const availableChats = $derived(
chats.list
@@ -71,6 +76,22 @@
}
}
async function syncContactList() {
if (syncingContacts) {
return;
}
syncingContacts = true;
try {
await syncContacts();
toasts.success("Синхронизация контактов запущена");
version += 1;
} catch {
toasts.error("Не удалось синхронизировать контакты");
} finally {
syncingContacts = false;
}
}
onMount(() => {
chats.load();
});
@@ -89,6 +110,21 @@
<span>Синхронизировать диалоги</span>
</Button>
</div>
<p class="hint">
Контакты подтягиваются отдельно — тогда в поиске появятся люди, с которыми
ещё не было переписки.
</p>
<div class="action">
<Button
variant="secondary"
fluid
loading={syncingContacts}
onclick={syncContactList}
>
<Icon name="user" />
<span>Синхронизировать контакты</span>
</Button>
</div>
</section>
<section>