10 lines
396 B
TypeScript
10 lines
396 B
TypeScript
import { useContext } from "react";
|
|
import { AvatarContext } from "./AvatarProvider";
|
|
|
|
export function useSaveAvatar() : (fromPublicKey: string, path : string, decryptedContent : string) => Promise<void> {
|
|
const context : any = useContext(AvatarContext);
|
|
if(!context){
|
|
throw new Error("useSaveAvatar must be used within an AvatarProvider");
|
|
}
|
|
return context.saveAvatar;
|
|
} |