Skip to content

Commit

Permalink
dynamically format address based on cartridge connector
Browse files Browse the repository at this point in the history
  • Loading branch information
starknetdev committed Sep 5, 2024
1 parent 5816e95 commit dc654a8
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions ui/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import LeaderboardScreen from "@/app/containers/LeaderboardScreen";
import EncountersScreen from "@/app/containers/EncountersScreen";
import GuideScreen from "@/app/containers/GuideScreen";
import UpgradeScreen from "@/app/containers/UpgradeScreen";
import { padAddress } from "@/app/lib/utils";
import { indexAddress, padAddress } from "@/app/lib/utils";
import { TxActivity } from "@/app/components/navigation/TxActivity";
import useLoadingStore from "@/app/hooks/useLoadingStore";
import useAdventurerStore from "@/app/hooks/useAdventurerStore";
Expand Down Expand Up @@ -67,6 +67,7 @@ import { VRF_WAIT_TIME } from "@/app/lib/constants";
import InterludeScreen from "@/app/containers/InterludeScreen";
import CollectionsLeaderboardScreen from "./containers/CollectionsLeaderboardScreen";
import TopUp from "@/app/containers/TopUp";
import { checkCartridgeConnector } from "@/app/lib/connectors";

const allMenuItems: Menu[] = [
{ id: 1, label: "Start", screen: "start", disabled: false },
Expand Down Expand Up @@ -240,7 +241,9 @@ function Home() {

const getBalances = async () => {
const balances = await fetchBalances(
address ?? "0x0",
checkCartridgeConnector(connector)
? indexAddress(owner ?? "0x0").toLowerCase()
: owner ?? "0x0",
ethContract,
lordsContract,
gameContract
Expand Down Expand Up @@ -335,7 +338,9 @@ function Home() {

const ownerVariables = useMemo(() => {
return {
owner: owner,
owner: checkCartridgeConnector(connector)
? indexAddress(owner ?? "0x0").toLowerCase()
: owner ?? "0x0",
health: 0,
skip: 0,
};
Expand Down

0 comments on commit dc654a8

Please sign in to comment.