diff --git a/client/lib/aethex-social-service.ts b/client/lib/aethex-social-service.ts index ed18b99d..f6fdd5da 100644 --- a/client/lib/aethex-social-service.ts +++ b/client/lib/aethex-social-service.ts @@ -2,16 +2,19 @@ import { supabase } from "./supabase"; export const aethexSocialService = { async listRecommended(userId: string, limit = 10) { - const { data, error } = await supabase - .from("user_profiles") - .select("id, username, full_name, avatar_url, bio") - .neq("id", userId) - .limit(limit); - if (error) { - console.warn("listRecommended error:", error); - return [] as any[]; - } - return data as any[]; + try { + const { data, error } = await supabase + .from("user_profiles") + .select("id, username, full_name, avatar_url, bio") + .neq("id", userId) + .limit(limit); + if (!error && data) return data as any[]; + } catch {} + try { + const raw = localStorage.getItem("demo_profiles"); + const profiles = raw ? JSON.parse(raw) : []; + return profiles.filter((p:any)=>p.id!==userId).slice(0, limit); + } catch { return [] as any[]; } }, async getFollowing(userId: string): Promise {