import { getUserInfo } from '@/api/cacheLiving.js'
import { oncePerSession, clearDedupeKey } from './liveRequestGuard.js'

/** 用户信息（会话内只请求一次） */
export function fetchLiveUserInfo(refresh = false) {
	return oncePerSession('app:userInfo', () => getUserInfo(), { refresh })
}

export function clearLiveUserInfoCache() {
	clearDedupeKey('app:userInfo')
}
