Composer update (react-query refactor) (#1899)
* Move composer state to a context * Rework composer to use RQ --------- Co-authored-by: Eric Bailey <git@esb.lol>
This commit is contained in:
parent
c687172de9
commit
0a26e78dcb
32 changed files with 269 additions and 239 deletions
|
@ -12,7 +12,7 @@ import {
|
|||
SuggestionProps,
|
||||
SuggestionKeyDownProps,
|
||||
} from '@tiptap/suggestion'
|
||||
import {UserAutocompleteModel} from 'state/models/discovery/user-autocomplete'
|
||||
import {ActorAutocomplete} from '#/state/queries/actor-autocomplete'
|
||||
import {usePalette} from 'lib/hooks/usePalette'
|
||||
import {Text} from 'view/com/util/text/Text'
|
||||
import {UserAvatar} from 'view/com/util/UserAvatar'
|
||||
|
@ -23,15 +23,14 @@ interface MentionListRef {
|
|||
}
|
||||
|
||||
export function createSuggestion({
|
||||
autocompleteView,
|
||||
autocomplete,
|
||||
}: {
|
||||
autocompleteView: UserAutocompleteModel
|
||||
autocomplete: ActorAutocomplete
|
||||
}): Omit<SuggestionOptions, 'editor'> {
|
||||
return {
|
||||
async items({query}) {
|
||||
autocompleteView.setActive(true)
|
||||
await autocompleteView.setPrefix(query)
|
||||
return autocompleteView.suggestions.slice(0, 8)
|
||||
await autocomplete.query(query)
|
||||
return autocomplete.suggestions.slice(0, 8)
|
||||
},
|
||||
|
||||
render: () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue