Skip to content

Commit

Permalink
fix: extract lastconnectedtime to scaffoldconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
Iwueseiter committed Oct 6, 2024
1 parent c3cbd12 commit cac0df1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { BurnerConnector } from "~~/services/web3/stark-burner/BurnerConnector";
import { useTheme } from "next-themes";
import { BlockieAvatar } from "../BlockieAvatar";
import GenericModal from "./GenericModal";
import scaffoldConfig from "~~/scaffold.config";

const loader = ({ src }: { src: string }) => {
return src;
};
Expand All @@ -26,7 +28,7 @@ const ConnectModal = () => {
);
const [, setLastConnectionTime] = useLocalStorage<number>(
"lastConnectionTime",
0,
scaffoldConfig.lastConnectedTime,
);

const handleCloseModal = () => {
Expand Down
2 changes: 2 additions & 0 deletions packages/nextjs/scaffold.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export type ScaffoldConfig = {
onlyLocalBurnerWallet: boolean;
rpcProviderUrl: string;
walletAutoConnect: boolean;
lastConnectedTime: number;
autoConnectTTL: number;
};

Expand All @@ -17,6 +18,7 @@ const scaffoldConfig = {
// The interval at which your front-end polls the RPC servers for new data
// it has no effect if you only target the local network (default is 30_000)
pollingInterval: 30_000,
lastConnectedTime: 0,
/**
* Auto connect:
* 1. If the user was connected into a wallet before, on page reload reconnect automatically
Expand Down

0 comments on commit cac0df1

Please sign in to comment.