From f2df1daad997aba758a98bb05daa32ad7e08fd52 Mon Sep 17 00:00:00 2001 From: lianahus Date: Mon, 2 Aug 2021 10:39:37 +0200 Subject: [PATCH] hiding slinther checkbox when remixd deactivated --- .../src/lib/remix-ui-static-analyser.tsx | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 56af61fe9c..70f5b20b51 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 @@ -94,6 +94,19 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => { setSlitherEnabled(false) } }) + props.analysisModule.on('manager', 'pluginDeactivated', (plugin) => { + // Reset warning state + setWarningState([]) + // Reset badge + props.event.trigger('staticAnaysisWarning', []) + // Reset state + dispatch({ type: '', payload: {} }) + // Hide 'Enable Slither Analysis' checkbox + if (plugin.name === 'remixd') { + setShowSlither('hidden') + setSlitherEnabled(false) + } + }) return () => { } }, [props])