fix: let useUserById accept undefined userId (#648)
This commit is contained in:
parent
0c328bc398
commit
a93e64c830
|
@ -46,7 +46,7 @@ export const usePrivateUser = (userId?: string) => {
|
|||
return privateUser
|
||||
}
|
||||
|
||||
export const useUserById = (userId: string) => {
|
||||
export const useUserById = (userId = '_') => {
|
||||
const result = useFirestoreDocumentData<DocumentData, User>(
|
||||
['users', userId],
|
||||
doc(users, userId),
|
||||
|
|
|
@ -17,7 +17,7 @@ export default function ClaimPage() {
|
|||
const [claiming, setClaiming] = useState(false)
|
||||
const [error, setError] = useState<string | undefined>(undefined)
|
||||
|
||||
const fromUser = useUserById(manalink?.fromId ?? '_loading')
|
||||
const fromUser = useUserById(manalink?.fromId)
|
||||
if (!manalink) {
|
||||
return <></>
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user