Skip to content

Commit

Permalink
Fix models name
Browse files Browse the repository at this point in the history
  • Loading branch information
Matth26 committed Nov 30, 2024
1 parent 77d341c commit 1a7754c
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 5 deletions.
10 changes: 5 additions & 5 deletions client/src/dojo/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ export async function setup({ ...config }: Config) {
keys: [undefined],
pattern_matching: "FixedLen",
models: [
"zKube-Game",
"zKube-Player",
"zKube-Tournament",
"zKube-Settings",
"zkube-Game",
"zkube-Player",
"zkube-Tournament",
"zkube-Settings",
"zkube-Chest",
"zkube-Participation",
"zKube-Admin",
"zkube-Admin",
],
};

Expand Down
32 changes: 32 additions & 0 deletions client/src/ui/screens/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,18 @@ import { useGrid } from "@/hooks/useGrid";
import Tutorial from "../components/Tutorial/Tutorial";
import Swipper from "../components/Swipper";
import HeaderBalance from "../components/HeaderBalance";
import { useDojo } from "@/dojo/useDojo";
import { getSyncEntities } from "@dojoengine/state";
import * as torii from "@dojoengine/torii-client";

export const Home = () => {
useViewport();
useRewardsCalculator();
const isSigning = false; //useAutoSignup();

const {
setup: { toriiClient, contractComponents },
} = useDojo();
const { account } = useAccountCustom();
const { player } = usePlayer({ playerId: account?.address });

Expand All @@ -64,6 +70,32 @@ export const Home = () => {
const [score, setScore] = useState<number | undefined>(0);
const [imgData, setImgData] = useState<string>("");

useEffect(() => {
const clause: torii.MemberClause = {
model: "zkube-Mint",
member: "id",
operator: "Eq",
value: {
Primitive: {
Felt252: account?.address,
},
},
};

const syncEntities = async () => {
await getSyncEntities(
toriiClient,
contractComponents as any,
{ Member: clause },
[],
100,
false,
);
};

syncEntities();
}, [account?.address]);

const isMdOrLarger = useMediaQuery({ query: "(min-width: 768px)" });

// State variables for modals
Expand Down

0 comments on commit 1a7754c

Please sign in to comment.