update channel
This commit is contained in:
@@ -3,12 +3,11 @@ import useSWR from 'swr';
|
||||
const fetcher = (url: string) => fetch(url).then((r: any) => r.json());
|
||||
|
||||
export const useProfile = (pubkey: string) => {
|
||||
const { data, error } = useSWR(`https://rbr.bio/${pubkey}/metadata.json`, fetcher);
|
||||
if (error) {
|
||||
return error;
|
||||
}
|
||||
if (data) {
|
||||
return JSON.parse(data.content);
|
||||
}
|
||||
return null;
|
||||
const { data, error, isLoading } = useSWR(`https://us.rbr.bio/${pubkey}/metadata.json`, fetcher);
|
||||
|
||||
return {
|
||||
user: data ? JSON.parse(data.content ? data.content : null) : null,
|
||||
isLoading,
|
||||
isError: error,
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user