From e17ea193d0d8c1363a77e6540d6830fc587059f5 Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Tue, 27 Jun 2023 20:44:36 +0100 Subject: [PATCH] needed conditional check --- .../src/lib/remix-ui-static-analyser.tsx | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx b/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx index 7521210123..7cdab72564 100644 --- a/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx +++ b/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx @@ -368,28 +368,28 @@ useEffect(() => { }, [hideWarnings, showLibsWarning]) useEffect(() => { - const slitherTotal = slitherWarnings && state.data && state.source !== null + const slitherTotal = slitherEnabled && showSlither && slitherWarnings && state.data && state.source !== null ? slitherWarnings.filter((x) => !x.options.isLibrary && x.hasWarning).length : 0 - const ssaTotal = ssaWarnings && state.data && state.source !== null + const ssaTotal = basicEnabled && ssaWarnings && state.data && state.source !== null ? ssaWarnings.filter((x) => !x.options.isLibrary && x.hasWarning).length : 0 - const hintsTotal = hints && state.data && state.source !== null ? hints.length : 0 + const hintsTotal = solhintEnabled && hints && state.data && state.source !== null ? hints.length : 0 console.log('hideWarnings & showLibsWarning are unchecked and lengths have changed', { slitherTotal, ssaTotal, hintsTotal }) props.event.trigger('staticAnaysisWarning', [slitherTotal + ssaTotal + hintsTotal]) }, [hints.length, slitherWarnings.length, ssaWarnings.length]) -useEffect(() => { - const slitherTotal = slitherWarnings && slitherEnabled && showSlither && state.data && state.source !== null - ? slitherWarnings.filter((x) => !x.options.isLibrary && x.hasWarning).length - : 0 - const ssaTotal = ssaWarnings && basicEnabled && state.data && state.source !== null - ? ssaWarnings.filter((x) => !x.options.isLibrary && x.hasWarning).length - : 0 - const hintsTotal = hints && solhintEnabled && state.data && state.source !== null ? hints.length : 0 - console.log('hideWarnings & showLibsWarning are unchecked and tools could be checked or unchecked', { slitherTotal, ssaTotal, hintsTotal }) - props.event.trigger('staticAnaysisWarning', [slitherTotal + ssaTotal + hintsTotal]) -}, [solhintEnabled, basicEnabled, slitherEnabled, showSlither]) +// useEffect(() => { +// const slitherTotal = slitherWarnings && slitherEnabled && showSlither && state.data && state.source !== null +// ? slitherWarnings.filter((x) => !x.options.isLibrary && x.hasWarning).length +// : 0 +// const ssaTotal = ssaWarnings && basicEnabled && state.data && state.source !== null +// ? ssaWarnings.filter((x) => !x.options.isLibrary && x.hasWarning).length +// : 0 +// const hintsTotal = hints && solhintEnabled && state.data && state.source !== null ? hints.length : 0 +// console.log('hideWarnings & showLibsWarning are unchecked and tools could be checked or unchecked', { slitherTotal, ssaTotal, hintsTotal }) +// props.event.trigger('staticAnaysisWarning', [slitherTotal + ssaTotal + hintsTotal]) +// }, [solhintEnabled, basicEnabled, slitherEnabled, showSlither]) const handleSlitherEnabled = async () => { const checkRemixd = await props.analysisModule.call('manager', 'isActive', 'remixd')