(feat): more crypto migration
Some checks failed
/ build-web (push) Failing after 5m33s
/ build-desktop (linux) (push) Failing after 5m46s
/ build-mobile (push) Failing after 7m58s
/ release (push) Has been skipped

This commit is contained in:
Alois 2026-07-06 00:13:26 +02:00
commit 2777ba34ca
11 changed files with 504 additions and 715 deletions

View file

@ -79,6 +79,7 @@ export default function Screen() {
liveMessages,
clearLiveMessages,
userId,
chatSecret,
error,
errorDescription,
} = useChat();
@ -105,12 +106,13 @@ export default function Screen() {
const [value, setValue] = React.useState("");
const hasValidChatUser = Number.isSafeInteger(userId) && userId > 0;
const hasChatSecret = chatSecret !== null;
const messagesQuery = useInfiniteQuery({
queryKey: ["chat-messages", String(userId)],
queryKey: ["chat-messages", String(userId), hasChatSecret],
initialPageParam: 0,
queryFn: ({ pageParam }) => getMessages(PAGE_SIZE, Number(pageParam)),
enabled: hasValidChatUser,
enabled: hasValidChatUser && hasChatSecret,
getNextPageParam: (lastPage, allPages) => {
if (lastPage.length < PAGE_SIZE) {
return undefined;