Skip to content

Commit

Permalink
Merge pull request #75 from cardano-scaling/fix/game-not-connecting
Browse files Browse the repository at this point in the history
fix: game not connecting due to app rendering twice
  • Loading branch information
Quantumplation authored Nov 23, 2024
2 parents bf55896 + 2bfb7e2 commit a786f53
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
5 changes: 0 additions & 5 deletions src/components/DoomCanvas/DoomCanvas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { HydraMultiplayerClient } from "../../utils/HydraMultiplayer/client.js";

const DoomCanvas: React.FC = () => {
const canvasRef = useRef<HTMLCanvasElement>(null);
const isEffectRan = useRef(false);
const isGameDataFetched = useRef(false);
const {
gameData: { code, petName, type },
Expand Down Expand Up @@ -58,10 +57,6 @@ const DoomCanvas: React.FC = () => {
if (!address) return;
if (type !== EGameType.SOLO && !data?.ip) return;

// Prevent effect from running twice
if (isEffectRan.current) return;
isEffectRan.current = true;

const canvas = canvasRef.current;

if (!canvas) {
Expand Down
7 changes: 1 addition & 6 deletions src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import App from "./App.tsx";
import "./index.css";

createRoot(document.getElementById("root")!).render(
<StrictMode>
<App />
</StrictMode>,
);
createRoot(document.getElementById("root")!).render(<App />);

0 comments on commit a786f53

Please sign in to comment.