Remove local fallback in listProfiles
cgen-f8093d03b2844778b1abe6bef2d24c89
This commit is contained in:
parent
22e3ea7ac8
commit
a53162600b
1 changed files with 4 additions and 17 deletions
|
|
@ -193,22 +193,9 @@ export const aethexUserService = {
|
|||
|
||||
if (error) {
|
||||
if (isTableMissing(error)) {
|
||||
console.warn('user_profiles table missing during listProfiles - returning local demo profiles');
|
||||
try {
|
||||
const keys = Object.keys(localStorage || {}).filter((k) => k.startsWith('demo_profile_'));
|
||||
const profiles = keys
|
||||
.map((k) => {
|
||||
try {
|
||||
return JSON.parse(localStorage.getItem(k) || "null");
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
})
|
||||
.filter(Boolean) as AethexUserProfile[];
|
||||
return profiles.slice(0, limit);
|
||||
} catch {
|
||||
return [];
|
||||
}
|
||||
throw new Error(
|
||||
'Supabase table "user_profiles" is missing. Please run the required migrations.',
|
||||
);
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
|
|
@ -619,7 +606,7 @@ export const aethexAchievementService = {
|
|||
if (achievement) {
|
||||
aethexToast.aethex({
|
||||
title: "Achievement Unlocked! 🎉",
|
||||
description: `${achievement.icon || "🏅"} ${achievement.name} - ${achievement.description}`,
|
||||
description: `${achievement.icon || "<EFBFBD><EFBFBD>"} ${achievement.name} - ${achievement.description}`,
|
||||
duration: 8000,
|
||||
});
|
||||
await this.updateUserXPAndLevel(userId, achievement.xp_reward);
|
||||
|
|
|
|||
Loading…
Reference in a new issue