fix: isEmpty is not needed for searchTerm

because an empty string is falsy
pull/3083/head
William Grant 11 months ago
parent 22ad152be1
commit 8705fddd36

@ -83,9 +83,6 @@ export function SessionQRCode(props: SessionQRCodeProps) {
} }
setSvgDataURL(`data:image/svg+xml;charset=utf-8,${encodeURIComponent(svgString)}`); setSvgDataURL(`data:image/svg+xml;charset=utf-8,${encodeURIComponent(svgString)}`);
window.log.debug(
`WIP: [SessionQRCode] SVG logo fetched: ${logoImage} data:image/svg+xml;charset=utf-8,${encodeURIComponent(svgString)}`
);
} catch (error) { } catch (error) {
window.log.error('Error fetching the QR Code logo which is an svg:', error); window.log.error('Error fetching the QR Code logo which is an svg:', error);
} }

@ -1,5 +1,5 @@
import { Dispatch } from '@reduxjs/toolkit'; import { Dispatch } from '@reduxjs/toolkit';
import { debounce, isEmpty } from 'lodash'; import { debounce } from 'lodash';
import { useState } from 'react'; import { useState } from 'react';
import { useDispatch, useSelector } from 'react-redux'; import { useDispatch, useSelector } from 'react-redux';
import styled from 'styled-components'; import styled from 'styled-components';
@ -54,7 +54,7 @@ const doTheSearch = (dispatch: Dispatch<any>, cleanedTerm: string) => {
const debouncedSearch = debounce(doTheSearch, 50); const debouncedSearch = debounce(doTheSearch, 50);
function updateSearch(dispatch: Dispatch<any>, searchTerm: string) { function updateSearch(dispatch: Dispatch<any>, searchTerm: string) {
if (isEmpty(searchTerm)) { if (!searchTerm) {
dispatch(clearSearch()); dispatch(clearSearch());
return; return;
} }

Loading…
Cancel
Save