refactor relay provider

This commit is contained in:
Ren Amamiya
2023-04-24 08:17:26 +07:00
parent f671521356
commit d52410b857
27 changed files with 113 additions and 87 deletions
+3 -3
View File
@@ -4,7 +4,7 @@ import NewsfeedLayout from '@components/layouts/newsfeed';
import { RelayContext } from '@components/relaysProvider';
import { chatMessagesAtom } from '@stores/chat';
import { FULL_RELAYS } from '@stores/constants';
import { MESSAGE_RELAYS } from '@stores/constants';
import { usePageContext } from '@utils/hooks/usePageContext';
@@ -20,7 +20,7 @@ export function Page() {
const pubkey = searchParams.pubkey;
const [pool]: any = useContext(RelayContext);
const pool: any = useContext(RelayContext);
const [activeAccount]: any = useLocalStorage('account', {});
const setChatMessages = useSetAtom(chatMessagesAtom);
@@ -40,7 +40,7 @@ export function Page() {
'#p': [pubkey],
},
],
FULL_RELAYS,
MESSAGE_RELAYS,
(event: any) => {
setChatMessages((prev) => [...prev, event]);
}