Skip to content

Commit

Permalink
refactor: PR suggested change
Browse files Browse the repository at this point in the history
  • Loading branch information
Himanshu Singh authored and Himanshu Singh committed Oct 16, 2023
1 parent 20d382b commit 02a6ffa
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 17 deletions.
1 change: 0 additions & 1 deletion deploy-web/src/components/layout/WelcomeModal.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Button, Dialog, DialogContent, DialogActions, Typography, Box, Paper, useTheme } from "@mui/material";
import { useKeplr } from "@src/context/WalletProvider";
// import { feePercent, maxFee } from "@src/utils/constants";
import { FormattedNumber } from "react-intl";
import { makeStyles } from "tss-react/mui";
Expand Down
10 changes: 6 additions & 4 deletions deploy-web/src/context/WalletProvider/WalletProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,16 @@ export const WalletProvider = ({ children }) => {
setIsWalletLoaded(true);
}

window.addEventListener("keplr_keystorechange", () => onKeystoreChange(Wallets.KEPLR));
window.addEventListener("leap_keystorechange", () => onKeystoreChange(Wallets.LEAP));
const keplrOnKeystoreChange = () => onKeystoreChange(Wallets.KEPLR);
const leapOnKeystoreChange = () => onKeystoreChange(Wallets.LEAP);
window.addEventListener("keplr_keystorechange", keplrOnKeystoreChange);
window.addEventListener("leap_keystorechange", leapOnKeystoreChange);

return () => {
isMounted.current = false;

window.removeEventListener("keplr_keystorechange", () => onKeystoreChange(Wallets.KEPLR));
window.removeEventListener("leap_keystorechange", () => onKeystoreChange(Wallets.LEAP));
window.removeEventListener("keplr_keystorechange", keplrOnKeystoreChange);
window.removeEventListener("leap_keystorechange", leapOnKeystoreChange);
};
} else {
setIsWalletLoaded(true);
Expand Down
8 changes: 0 additions & 8 deletions deploy-web/src/types/gloabl.d.ts

This file was deleted.

9 changes: 5 additions & 4 deletions deploy-web/src/types/global.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Window as KeplrWindow } from "@keplr-wallet/types";

import { Keplr, Window as KeplrWindow } from "@keplr-wallet/types";
declare global {
// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface Window extends KeplrWindow {}
interface Window extends KeplrWindow {
wallet: Keplr;
leap: Keplr;
}
}

0 comments on commit 02a6ffa

Please sign in to comment.