use swr for subscribe relaypool (only chats/channels page)

This commit is contained in:
Ren Amamiya
2023-04-22 08:09:17 +07:00
parent 2239606235
commit 340f6e4806
6 changed files with 78 additions and 26 deletions

View File

@@ -1,15 +1,14 @@
import ChannelMessageItem from '@components/channels/messages/item';
import { Placeholder } from '@components/note/placeholder';
import { sortedChannelMessagesAtom } from '@stores/channel';
import { useAtomValue } from 'jotai';
import { useCallback, useRef } from 'react';
import Skeleton from 'react-loading-skeleton';
import { Virtuoso } from 'react-virtuoso';
export const ChannelMessages = () => {
const virtuosoRef = useRef(null);
const data = useAtomValue(sortedChannelMessagesAtom);
const itemContent: any = useCallback(
@@ -46,6 +45,5 @@ export const ChannelMessages = () => {
};
const COMPONENTS = {
EmptyPlaceholder: () => <Placeholder />,
ScrollSeekPlaceholder: () => <Placeholder />,
EmptyPlaceholder: () => <Skeleton />,
};