minor fixes

This commit is contained in:
Ren Amamiya
2023-04-24 15:29:40 +07:00
parent cdbf70591e
commit 3e31e7d4dc
12 changed files with 34 additions and 26 deletions

View File

@@ -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;

View File

@@ -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;
};