Add offline fallback for user interests
cgen-f7a99da97c65425eb7484490c566ceab
This commit is contained in:
parent
129bea99d1
commit
89a9973440
1 changed files with 9 additions and 0 deletions
|
|
@ -549,6 +549,11 @@ export const aethexUserService = {
|
||||||
},
|
},
|
||||||
|
|
||||||
async addUserInterests(userId: string, interests: string[]): Promise<void> {
|
async addUserInterests(userId: string, interests: string[]): Promise<void> {
|
||||||
|
if (!isSupabaseConfigured) {
|
||||||
|
fallbackInterests.set(userId, Array.from(new Set(interests)));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
ensureSupabase();
|
ensureSupabase();
|
||||||
|
|
||||||
await supabase
|
await supabase
|
||||||
|
|
@ -577,6 +582,10 @@ export const aethexUserService = {
|
||||||
},
|
},
|
||||||
|
|
||||||
async getUserInterests(userId: string): Promise<string[]> {
|
async getUserInterests(userId: string): Promise<string[]> {
|
||||||
|
if (!isSupabaseConfigured) {
|
||||||
|
return fallbackInterests.get(userId) ?? [];
|
||||||
|
}
|
||||||
|
|
||||||
ensureSupabase();
|
ensureSupabase();
|
||||||
|
|
||||||
const { data, error } = await supabase
|
const { data, error } = await supabase
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue