Fix merge error
This commit is contained in:
parent
03f36cf954
commit
6914e5d706
|
@ -21,7 +21,7 @@ import {
|
||||||
import { app } from './init'
|
import { app } from './init'
|
||||||
import { PrivateUser, User } from '../../../common/user'
|
import { PrivateUser, User } from '../../../common/user'
|
||||||
import { createUser } from './api-call'
|
import { createUser } from './api-call'
|
||||||
import { getValues, listenForValue, listenForValues } from './utils'
|
import { getValue, getValues, listenForValue, listenForValues } from './utils'
|
||||||
export type { User }
|
export type { User }
|
||||||
|
|
||||||
const db = getFirestore(app)
|
const db = getFirestore(app)
|
||||||
|
@ -55,12 +55,10 @@ export function listenForUser(
|
||||||
|
|
||||||
export function listenForPrivateUser(
|
export function listenForPrivateUser(
|
||||||
userId: string,
|
userId: string,
|
||||||
setPrivateUser: (privateUser: PrivateUser) => void
|
setPrivateUser: (privateUser: PrivateUser | null) => void
|
||||||
) {
|
) {
|
||||||
const userRef = doc(db, 'private-users', userId)
|
const userRef = doc(db, 'private-users', userId)
|
||||||
return onSnapshot(userRef, (userSnap) => {
|
return listenForValue<PrivateUser>(userRef, setPrivateUser)
|
||||||
setPrivateUser(userSnap.data() as PrivateUser)
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const CACHED_USER_KEY = 'CACHED_USER_KEY'
|
const CACHED_USER_KEY = 'CACHED_USER_KEY'
|
||||||
|
|
Loading…
Reference in New Issue
Block a user