From 8705fddd36209e58053ddd08a7ce48d7914aeb8d Mon Sep 17 00:00:00 2001 From: William Grant Date: Wed, 5 Jun 2024 13:36:05 +1000 Subject: [PATCH] fix: isEmpty is not needed for searchTerm because an empty string is falsy --- ts/components/SessionQRCode.tsx | 3 --- ts/components/SessionSearchInput.tsx | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/ts/components/SessionQRCode.tsx b/ts/components/SessionQRCode.tsx index 856045dba..c80396f8c 100644 --- a/ts/components/SessionQRCode.tsx +++ b/ts/components/SessionQRCode.tsx @@ -83,9 +83,6 @@ export function SessionQRCode(props: SessionQRCodeProps) { } 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) { window.log.error('Error fetching the QR Code logo which is an svg:', error); } diff --git a/ts/components/SessionSearchInput.tsx b/ts/components/SessionSearchInput.tsx index 1836e85d0..d8df8fc7b 100644 --- a/ts/components/SessionSearchInput.tsx +++ b/ts/components/SessionSearchInput.tsx @@ -1,5 +1,5 @@ import { Dispatch } from '@reduxjs/toolkit'; -import { debounce, isEmpty } from 'lodash'; +import { debounce } from 'lodash'; import { useState } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import styled from 'styled-components'; @@ -54,7 +54,7 @@ const doTheSearch = (dispatch: Dispatch, cleanedTerm: string) => { const debouncedSearch = debounce(doTheSearch, 50); function updateSearch(dispatch: Dispatch, searchTerm: string) { - if (isEmpty(searchTerm)) { + if (!searchTerm) { dispatch(clearSearch()); return; }