Add ensureSupabase helper
cgen-979e81e5a48a4c67904db267282a72dd
This commit is contained in:
parent
78254e1e40
commit
b977c3c675
1 changed files with 8 additions and 0 deletions
|
|
@ -21,6 +21,14 @@ export interface AethexUserProfile extends UserProfile {
|
||||||
const isNonEmptyString = (value: unknown): value is string =>
|
const isNonEmptyString = (value: unknown): value is string =>
|
||||||
typeof value === "string" && value.trim().length > 0;
|
typeof value === "string" && value.trim().length > 0;
|
||||||
|
|
||||||
|
const ensureSupabase = () => {
|
||||||
|
if (!isSupabaseConfigured) {
|
||||||
|
throw new Error(
|
||||||
|
"Supabase is not configured. Please set VITE_SUPABASE_URL and VITE_SUPABASE_ANON_KEY.",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
export function checkProfileComplete(p?: AethexUserProfile | null): boolean {
|
export function checkProfileComplete(p?: AethexUserProfile | null): boolean {
|
||||||
if (!p) return false;
|
if (!p) return false;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue