Skip to content

Commit

Permalink
Feat:btc margin white list
Browse files Browse the repository at this point in the history
  • Loading branch information
lq0-github committed Jan 14, 2025
1 parent e2119df commit a883a7b
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions screens/MarginTrading/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,27 @@ import { ConnectWalletButton } from "../../components/Header/WalletButton";
const MarginTrading = () => {
const router = useRouter();
const dispatch = useAppDispatch();
const selectedWalletId = window.selector?.store?.getState()?.selectedWalletId;
const activeTab = useSelector((state: RootState) => state.tab.activeTab);
const accountId = useAccountId();
const [showLoginModal, setShowLoginModal] = useState(false);
const [showWhitelistModal, setShowWhitelistModal] = useState(false);
useEffect(() => {
if (!accountId) {
setShowLoginModal(true);
} else {
if (selectedWalletId === "btc-wallet") {
setShowLoginModal(false);
const isInWhitelist = MARGIN_WHITELIST.includes(accountId);
if (!isInWhitelist) {
setShowWhitelistModal(true);
setShowWhitelistModal(false);
} else {
if (!accountId) {
setShowLoginModal(true);
} else {
setShowLoginModal(false);
const isInWhitelist = MARGIN_WHITELIST.includes(accountId);
if (!isInWhitelist) {
setShowWhitelistModal(true);
}
}
}
}, [accountId]);
}, [accountId, selectedWalletId]);

const handleTabChange = (tab: string) => {
dispatch(setActiveTab(tab));
Expand Down

0 comments on commit a883a7b

Please sign in to comment.