Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function Filters() {
const { setCurrents, state } = useContext(store);
const queryCache = useQueryCache();
const channels = useChannels();
const handleSubmit = (e: FormEvent) => {
e.preventDefault();
if (e.target instanceof HTMLFormElement) {
const data = new FormData(e.target);
const channel = data.get("channel") as string | null;
const username = data.get("username") as string | null;
queryCache.invalidateQueries(["log", { channel: channel?.toLowerCase(), username: username?.toLowerCase() }]);
setCurrents(channel, username);
}
};