Skip to content

Commit

Permalink
fix: Address an issue which causes the viewscreen to not load
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderson1993 committed Jul 25, 2024
1 parent d728b94 commit c34f3ef
Showing 1 changed file with 35 additions and 32 deletions.
67 changes: 35 additions & 32 deletions client/app/cards/Viewscreen/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { Suspense, useEffect, useState } from "react";
import { Quaternion } from "three";
import { Fuzz } from "./Fuzz";
import { WarpStars } from "./WarpStars";
import { CircleGridStoreProvider } from "@client/cards/Pilot/useCircleGridStore";

const forwardQuaternion = new Quaternion(0, 1, 0, 0);

Expand Down Expand Up @@ -58,38 +59,40 @@ export function Viewscreen() {

return (
<div className="w-full h-full flex items-center justify-center text-white text-6xl">
<StarmapCanvas>
<ViewscreenEffects onDone={() => setInitialized(true)} />
{initialized ? (
<>
<pointLight
intensity={0.2}
decay={2}
position={[10000000, 10000000, 1000000]}
/>
<pointLight
intensity={0.1}
decay={2}
position={[-10000000, -10000000, -1000000]}
/>
<ambientLight intensity={0.5} />
<Suspense fallback={null}>
<Fuzz />
</Suspense>
<Suspense fallback={null}>
<WarpStars />
</Suspense>
<Suspense fallback={null}>
<Nebula />
</Suspense>
{currentSystem === null ? (
<InterstellarWrapper />
) : (
<SolarSystemWrapper />
)}
</>
) : null}
</StarmapCanvas>
<CircleGridStoreProvider>
<StarmapCanvas>
<ViewscreenEffects onDone={() => setInitialized(true)} />
{initialized ? (
<>
<pointLight
intensity={0.2}
decay={2}
position={[10000000, 10000000, 1000000]}
/>
<pointLight
intensity={0.1}
decay={2}
position={[-10000000, -10000000, -1000000]}
/>
<ambientLight intensity={0.5} />
<Suspense fallback={null}>
<Fuzz />
</Suspense>
<Suspense fallback={null}>
<WarpStars />
</Suspense>
<Suspense fallback={null}>
<Nebula />
</Suspense>
{currentSystem === null ? (
<InterstellarWrapper />
) : (
<SolarSystemWrapper />
)}
</>
) : null}
</StarmapCanvas>
</CircleGridStoreProvider>
</div>
);
}

0 comments on commit c34f3ef

Please sign in to comment.