refactor: cleanup codebase — remove hydration guards, extract constants, fix bugs
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m20s
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m20s
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import { useState, useEffect, useCallback } from 'react';
|
||||
import { useState, useCallback } from 'react';
|
||||
import { useShallow } from 'zustand/react/shallow';
|
||||
import { usePrestigeStore, useGameStore } from '@/lib/game/stores';
|
||||
import { PRESTIGE_DEF } from '@/lib/game/constants/prestige';
|
||||
@@ -186,8 +186,6 @@ function ResetLoopSection({ loopInsight, onReset }: { loopInsight: number; onRes
|
||||
// ─── Main Component ───────────────────────────────────────────────────────────
|
||||
|
||||
export function PrestigeTab() {
|
||||
const [mounted, setMounted] = useState(false);
|
||||
|
||||
const {
|
||||
insight,
|
||||
totalInsight,
|
||||
@@ -212,11 +210,6 @@ export function PrestigeTab() {
|
||||
|
||||
const startNewLoop = useGameStore((s) => s.startNewLoop);
|
||||
|
||||
useEffect(() => {
|
||||
// eslint-disable-next-line react-hooks/set-state-in-effect
|
||||
setMounted(true);
|
||||
}, []);
|
||||
|
||||
const handlePurchase = useCallback((id: string) => {
|
||||
doPrestige(id);
|
||||
}, [doPrestige]);
|
||||
@@ -225,14 +218,6 @@ export function PrestigeTab() {
|
||||
startNewLoop();
|
||||
}, [startNewLoop]);
|
||||
|
||||
if (!mounted) {
|
||||
return (
|
||||
<div className="flex items-center justify-center p-8 text-gray-500">
|
||||
Loading prestige…
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
const upgradeEntries = Object.entries(PRESTIGE_DEF);
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user