diff options
Diffstat (limited to 'src/view/com/composer/text-input/TextInput.web.tsx')
-rw-r--r-- | src/view/com/composer/text-input/TextInput.web.tsx | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/view/com/composer/text-input/TextInput.web.tsx b/src/view/com/composer/text-input/TextInput.web.tsx index 7690a5876..4c31da338 100644 --- a/src/view/com/composer/text-input/TextInput.web.tsx +++ b/src/view/com/composer/text-input/TextInput.web.tsx @@ -17,9 +17,7 @@ import {isUriImage, blobToDataUri} from 'lib/media/util' import {Emoji} from './web/EmojiPicker.web' import {LinkDecorator} from './web/LinkDecorator' import {generateJSON} from '@tiptap/html' -import {ActorAutocomplete} from '#/state/queries/actor-autocomplete' -import {useSession} from '#/state/session' -import {useMyFollowsQuery} from '#/state/queries/my-follows' +import {useActorAutocompleteFn} from '#/state/queries/actor-autocomplete' export interface TextInputRef { focus: () => void @@ -52,15 +50,7 @@ export const TextInput = React.forwardRef(function TextInputImpl( TextInputProps, ref, ) { - const {agent} = useSession() - const autocomplete = React.useMemo( - () => new ActorAutocomplete(agent), - [agent], - ) - const {data: follows} = useMyFollowsQuery() - if (follows) { - autocomplete.setFollows(follows) - } + const autocomplete = useActorAutocompleteFn() const modeClass = useColorSchemeStyle('ProseMirror-light', 'ProseMirror-dark') const extensions = React.useMemo( |