From 9bea0dafa74de51ab2c8b3101d737f8bbadd65df Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Mon, 19 Jul 2021 19:05:23 +0530 Subject: [PATCH] reset warnings and badge on workspace change --- .../src/lib/remix-ui-static-analyser.tsx | 10 ++++++++++ 1 file changed, 10 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 bdf361e8c9..2317e74a2f 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 @@ -77,6 +77,16 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => { return () => { } }, [state]) + useEffect(() => { + props.analysisModule.on('filePanel', 'setWorkspace', () => { + // Reset warning state + setWarningState([]) + // Reset badge + props.event.trigger('staticAnaysisWarning', []) + }) + return () => { } + }, [props.analysisModule]) + const message = (name, warning, more, fileName, locationString) : string => { return (`