fix errors

This commit is contained in:
plebeius.eth
2023-06-26 22:07:32 +02:00
parent c630d08acf
commit cd1b62af4e
5 changed files with 16 additions and 14 deletions
+4 -2
View File
@@ -3,7 +3,7 @@ import { useAccount } from "@plebbit/plebbit-react-hooks";
import useAnonModeStore from "./stores/useAnonModeStore";
const useAnonMode = (threadCid, execute) => {
const { account } = useAccount();
const account = useAccount();
const { anonymousMode } = useAnonModeStore();
useEffect(() => {
@@ -13,7 +13,9 @@ useEffect(() => {
if (!anonymousMode) {
if (execute && storedSigners[threadCid]) {
const signerPrivateKey = storedSigners[threadCid];
await account.plebbit.createSigner({privateKey: signerPrivateKey});
if (account) {
await account.plebbit.createSigner({privateKey: signerPrivateKey});
}
}
}
}