minor fixes
This commit is contained in:
@@ -16,6 +16,7 @@ export function PageContextProvider({
|
||||
return <Context.Provider value={pageContext}>{children}</Context.Provider>;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line react-refresh/only-export-components
|
||||
export function usePageContext() {
|
||||
const pageContext = useContext(Context);
|
||||
return pageContext;
|
||||
|
||||
@@ -35,9 +35,9 @@ export const useProfileMetadata = (pubkey: string) => {
|
||||
fetchProfileMetadata(pubkey).then((res: any) => {
|
||||
if (res) {
|
||||
// update state
|
||||
setProfile(res);
|
||||
setProfile(JSON.parse(res.content));
|
||||
// insert to db
|
||||
insertPlebToDB(pubkey, JSON.stringify(res));
|
||||
insertPlebToDB(pubkey, res.content);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -48,7 +48,7 @@ export const useProfileMetadata = (pubkey: string) => {
|
||||
return () => {
|
||||
ignore = true;
|
||||
};
|
||||
}, [insertPlebToDB, pubkey]);
|
||||
}, [getProfileFromDB, insertPlebToDB, pubkey]);
|
||||
|
||||
return profile;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user