Skip to content

Commit

Permalink
chore: make useMyPersonas only run in options
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack-Works committed Dec 18, 2019
1 parent 3e5f3c9 commit ea6b9bf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/DataSource/useActivatedUI.ts
Expand Up @@ -2,7 +2,7 @@ import { Profile } from '../../database'
import { useValueRef } from '../../utils/hooks/useValueRef'
import { getActivatedUI } from '../../social-network/ui'
import { currentSelectedIdentity } from '../../components/shared-settings/settings'
import { GetContext } from '@holoflows/kit/es'
import { GetContext, OnlyRunInContext } from '@holoflows/kit/es'

export function useFriendsList() {
return useValueRef(getActivatedUI().friendsRef)
Expand All @@ -17,9 +17,9 @@ export function useMyIdentities() {
return useValueRef(getActivatedUI().myIdentitiesRef)
}
export function useMyPersonas() {
OnlyRunInContext('options', 'useMyPersonas')
const personasRef = useValueRef(getActivatedUI().myPersonasRef)
if (GetContext() === 'options') return personasRef
return []
return personasRef
}
export function useCurrentIdentity(noDefault?: boolean): Profile | null {
const all = useMyIdentities()
Expand Down

0 comments on commit ea6b9bf

Please sign in to comment.