chore(build): refactor codebase for production

This commit is contained in:
shafin-r
2026-03-12 02:39:34 +06:00
parent 121cc2bf71
commit bd35f6a852
123 changed files with 3501 additions and 3254 deletions

View File

@ -434,9 +434,10 @@ export const Rewards = () => {
if (!user) return;
const authStorage = localStorage.getItem("auth-storage");
if (!authStorage) return;
const {
state: { token },
} = JSON.parse(authStorage) as { state?: { token?: string } };
const parsed = JSON.parse(authStorage) as {
state?: { token?: string };
} | null;
const token = parsed?.state?.token;
if (!token) return;
try {
setLoading(true);
@ -481,7 +482,7 @@ export const Rewards = () => {
// ✅ FIX 2: Safely cast user_rank — null becomes undefined so all optional chaining works
const ur = (leaderboard?.user_rank ?? undefined) as
| Record<string, unknown>
| Record<string, number>
| undefined;
const islandStats = getIslandStats(ur, activeTab);