chore(build): refactor codebase for production
This commit is contained in:
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user