feat: add new account management
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { useContext } from "react";
|
||||
import { LumeContext } from "../context";
|
||||
import { ArkContext } from "../provider";
|
||||
|
||||
export const useArk = () => {
|
||||
const context = useContext(LumeContext);
|
||||
const context = useContext(ArkContext);
|
||||
if (context === undefined) {
|
||||
throw new Error("Please import Ark Provider to use useArk() hook");
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { useArk } from "./useArk";
|
||||
|
||||
export function useProfile(pubkey: string) {
|
||||
@@ -10,7 +10,7 @@ export function useProfile(pubkey: string) {
|
||||
} = useQuery({
|
||||
queryKey: ["user", pubkey],
|
||||
queryFn: async () => {
|
||||
const profile = await ark.get_metadata(pubkey);
|
||||
const profile = await ark.get_profile(pubkey);
|
||||
if (!profile)
|
||||
throw new Error(
|
||||
`Cannot get metadata for ${pubkey}, will be retry after 10 seconds`,
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import { NDKKind, NDKTag } from "@nostr-dev-kit/ndk";
|
||||
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
||||
import { normalizeRelayUrl } from "nostr-fetch";
|
||||
import { useArk } from "./useArk";
|
||||
|
||||
export function useRelaylist() {
|
||||
|
||||
Reference in New Issue
Block a user