Merge branch 'ysj-delivery' into main
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { supabase, ensureSupabaseReady } from '@/components/supadb/aksupainstance.uts'
|
||||
import supabase, { supaReady } from '@/components/supadb/aksupainstance.uts'
|
||||
import type { UserProfile } from '@/types/mall-types.uts'
|
||||
|
||||
/**
|
||||
@@ -8,8 +8,8 @@ import type { UserProfile } from '@/types/mall-types.uts'
|
||||
*/
|
||||
export async function ensureUserProfile(sessionUser: UTSJSONObject): Promise<UserProfile | null> {
|
||||
try {
|
||||
await ensureSupabaseReady()
|
||||
|
||||
await supaReady
|
||||
|
||||
// 从 sessionUser 中获取用户ID和邮箱
|
||||
const userId = sessionUser.getString('id')
|
||||
const email = sessionUser.getString('email') ?? ''
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { supabase as supa, ensureSupabaseReady } from '@/components/supadb/aksupainstance.uts'
|
||||
import supa, { supaReady } from '@/components/supadb/aksupainstance.uts'
|
||||
import type { UserProfile, UserStats } from '@/pages/user/types.uts'
|
||||
import type { DeviceInfo } from '@/pages/sense/types.uts'
|
||||
import { SenseDataService, type DeviceParams } from '@/pages/sense/senseDataService.uts'
|
||||
@@ -50,7 +50,7 @@ export const setUserProfile = (profile : UserProfile) => {
|
||||
// 获取当前用户信息(含补全 profile)
|
||||
export async function getCurrentUser() : Promise<UserProfile | null> {
|
||||
try {
|
||||
await ensureSupabaseReady()
|
||||
await supaReady
|
||||
} catch (_) {}
|
||||
|
||||
const sessionInfo = supa.getSession()
|
||||
|
||||
Reference in New Issue
Block a user