Properly clean the modal when selecting an item

This commit is contained in:
Justin Edmund 2022-03-11 02:36:18 -08:00
parent 9e3bc95ec8
commit 5659568345

View file

@ -133,7 +133,7 @@ const SearchModal = (props: Props) => {
function sendData(result: Character | Weapon | Summon) {
props.send(result, props.fromPosition)
setOpen(false)
openChange()
}
function receiveFilters(filters: { [key: string]: number[] }) {
@ -256,7 +256,10 @@ const SearchModal = (props: Props) => {
function openChange() {
if (open) {
setQuery('')
setFirstLoad(true)
setResults([])
setRecordCount(0)
setCurrentPage(1)
setOpen(false)
} else {
setOpen(true)