mirror of
https://github.com/v0l/route96.git
synced 2025-06-14 15:46:32 +00:00
17 lines
421 B
TypeScript
17 lines
421 B
TypeScript
import { EventPublisher, Nip7Signer } from "@snort/system";
|
|
import { useMemo } from "react";
|
|
import useLogin from "./login";
|
|
|
|
export default function usePublisher() {
|
|
const login = useLogin();
|
|
|
|
return useMemo(() => {
|
|
switch (login?.type) {
|
|
case "nip7":
|
|
return new EventPublisher(new Nip7Signer(), login.pubkey);
|
|
default:
|
|
return undefined;
|
|
}
|
|
}, [login?.type, login?.pubkey]);
|
|
}
|