Skip to content

Commit

Permalink
chore: set ssr if window is undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
slavastartsev committed Oct 8, 2024
1 parent d6aeb9f commit bf8b698
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions packages/sats-wagmi/src/provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,17 @@ type SatsWagmiConfigProps = {
children: ReactNode;
network?: BitcoinNetwork;
queryClient: QueryClient;
ssr?: boolean;
};

const SatsWagmiConfig: FC<SatsWagmiConfigProps> = ({
children,
queryClient,
network = BitcoinNetwork.mainnet,
ssr = false
}) => {
const SatsWagmiConfig: FC<SatsWagmiConfigProps> = ({ children, queryClient, network = BitcoinNetwork.mainnet }) => {
const [connectors, setConnectors] = useState<SatsConnector[]>([]);
const [connector, setCurrentConnector] = useState<SatsConnector>();

const [storedConnector, setStoredConnector] = useLocalStorage<string | undefined>(
LocalStorageKeys.CONNECTOR,
undefined,
{
initializeWithValue: !ssr
initializeWithValue: typeof window !== 'undefined'
}
);

Expand Down

0 comments on commit bf8b698

Please sign in to comment.