Skip to content

Commit

Permalink
[base] Fix ambient type issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mariuslundgard authored and rexxars committed Oct 6, 2020
1 parent 3a05c36 commit c06ff23
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/@sanity/base/src/user-color/hooks.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {useContext} from 'react'
import {of} from 'rxjs'
import {empty} from 'rxjs'
import {useObservable} from '../util/useObservable'
import {UserColorManagerContext} from './context'
import {UserColor, UserColorManager} from './types'
Expand All @@ -11,5 +11,5 @@ export function useUserColorManager(): UserColorManager {
export function useUserColor(userId: string | null): UserColor {
const manager = useUserColorManager()

return useObservable(userId === null ? of(manager.get(null)) : manager.listen(userId))
return useObservable(userId ? manager.listen(userId) : empty(), manager.get(null))
}

0 comments on commit c06ff23

Please sign in to comment.