Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Commit

Permalink
TS & lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jacque006 committed Apr 9, 2024
1 parent b486198 commit 3ee3b07
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const AppContextProviderV2 = ({ children } : { children: ReactNode }) =>

setRecoveryConfigs(updatedConfigs);
localStorage.setItem(appContextLocalStorageKey, JSON.stringify(updatedConfigs));
}, []);
}, [recoveryConfigs]);

const { data: isModuleEnabled } = useReadContract({
address,
Expand Down Expand Up @@ -162,7 +162,8 @@ export const AppContextProviderV2 = ({ children } : { children: ReactNode }) =>
}, [
address,
firstSafeOwner,
writeContractAsync
writeContractAsync,
setRecoveryConfig
])

const requestRecovery = useCallback(async (newOwner: string) => {
Expand Down Expand Up @@ -190,7 +191,7 @@ export const AppContextProviderV2 = ({ children } : { children: ReactNode }) =>
)
console.debug('recovery request id', requestId)
// TODO poll until recovery req is complete or fails
}, [recoveryRouterAddr, address])
}, [recoveryRouterAddr, address, getRecoveryConfig])

const completeRecovery = useCallback(async () => {
if (!recoveryRouterAddr) {
Expand All @@ -212,7 +213,7 @@ export const AppContextProviderV2 = ({ children } : { children: ReactNode }) =>
{};

setRecoveryConfigs(cfgs);
});
}, []);

const ctxVal = useMemo(() => ({
recoveryConfigs,
Expand Down
10 changes: 4 additions & 6 deletions packages/demos/email-recovery/src/context/v2/AppContextV2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,11 @@ type AppContextTypeV2 = {
export const appContextV2 = createContext<AppContextTypeV2>({
recoveryConfigs: {},
// TODO Properly type return type, this will be overwritten in provider
getRecoveryConfig: (_address: string) => { return {} as any; },
setRecoveryConfig: (_cfg: RecoveryConfig) => {},
getRecoveryConfig: () => { return {} as any; },
setRecoveryConfig: () => {},
isModuleEnabled: false,
enableEmailRecoveryModule: async () => {},
configureRecoveryAndRequestGuardian: async(
_guardianEmail: string, _recoveryDelay: number
) => {},
requestRecovery: async (_newOwner: string) => {},
configureRecoveryAndRequestGuardian: async() => {},
requestRecovery: async () => {},
completeRecovery: async () => {},
});
3 changes: 2 additions & 1 deletion packages/demos/email-recovery/src/providers/Web3Provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import { ConnectKitProvider, getDefaultConfig } from "connectkit";
import { PropsWithChildren } from "react";

const connectKitOptions = {
walletConnectCTA: "both",
// TODO wat, why is cast needed?
walletConnectCTA: "both" as "both",
walletConnectName: "WalletConnect",
hideNoWalletCTA: true,
};
Expand Down

0 comments on commit 3ee3b07

Please sign in to comment.