wip: fully migrate to ark

This commit is contained in:
reya
2023-12-08 12:39:15 +07:00
parent 6f5ea1229d
commit e507187044
24 changed files with 141 additions and 2240 deletions
+1 -4
View File
@@ -12,16 +12,13 @@ import { useArk } from '@libs/ark';
import { LoaderIcon } from '@shared/icons';
import { User } from '@shared/user';
import { useNostr } from '@utils/hooks/useNostr';
export function ChatScreen() {
const { ark } = useArk();
const { pubkey } = useParams();
const { fetchNIP04Messages } = useNostr();
const { status, data } = useQuery({
queryKey: ['nip04-dm', pubkey],
queryFn: async () => {
return await fetchNIP04Messages(pubkey);
return await ark.getAllMessagesByPubkey({ pubkey });
},
refetchOnWindowFocus: false,
});
+4 -4
View File
@@ -5,16 +5,16 @@ import { Outlet } from 'react-router-dom';
import { ChatListItem } from '@app/chats/components/chatListItem';
import { useArk } from '@libs/ark';
import { LoaderIcon } from '@shared/icons';
import { useNostr } from '@utils/hooks/useNostr';
export function ChatsScreen() {
const { getAllNIP04Chats } = useNostr();
const { ark } = useArk();
const { status, data } = useQuery({
queryKey: ['nip04-chats'],
queryFn: async () => {
return await getAllNIP04Chats();
return await ark.getAllChats();
},
refetchOnWindowFocus: false,
refetchOnMount: false,