Clear prevSearch when closing modal

This commit is contained in:
Ken-Håvard Lieng 2020-05-07 08:10:25 +02:00
parent 497f9e882c
commit 0d085a2b4d
2 changed files with 49 additions and 48 deletions

File diff suppressed because one or more lines are too long

View File

@ -56,6 +56,7 @@ const AddChannel = () => {
dispatch(searchChannels(server, '')); dispatch(searchChannels(server, ''));
setTimeout(() => inputEl.current.focus(), 0); setTimeout(() => inputEl.current.focus(), 0);
} else { } else {
prevSearch.current = '';
setQ(''); setQ('');
} }
}, [modal.isOpen]); }, [modal.isOpen]);