Analyze button is enabled if none of Remix and Solhint are selected - fixed

pull/3838/head
Joseph Izang 1 year ago
parent 2e05d26670
commit 1bc19a50f8
  1. 10
      libs/remix-ui/static-analyser/src/lib/reducers/staticAnalysisReducer.ts
  2. 2
      libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx

@ -1,3 +1,4 @@
import { CompilationResult, SourceWithTarget } from "@remixproject/plugin-api"
import { RemixUiStaticAnalyserReducerActionType, RemixUiStaticAnalyserState } from "../../staticanalyser" import { RemixUiStaticAnalyserReducerActionType, RemixUiStaticAnalyserState } from "../../staticanalyser"
export const initialState: RemixUiStaticAnalyserState = { export const initialState: RemixUiStaticAnalyserState = {
@ -26,3 +27,12 @@ export const analysisReducer = (state: RemixUiStaticAnalyserState,
return initialState return initialState
} }
} }
type someReducerState = {
solhintEnabled?: boolean
basicEnabled?: boolean
slitherEnabled?: boolean
isSupportedVersion?: boolean
compiledState?: { data: CompilationResult, langVersion: string, fileName: string, source: SourceWithTarget, input: string }
}

@ -82,6 +82,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
const [slitherWarnings, setSlitherWarnings] = useState([]) const [slitherWarnings, setSlitherWarnings] = useState([])
const [ssaWarnings, setSsaWarnings] = useState([]) const [ssaWarnings, setSsaWarnings] = useState([])
const warningContainer = useRef(null) const warningContainer = useRef(null)
const allWarnings = useRef({}) const allWarnings = useRef({})
const [state, dispatch] = useReducer(analysisReducer, initialState) const [state, dispatch] = useReducer(analysisReducer, initialState)
@ -694,6 +695,7 @@ useEffect(() => {
}).flat().every(el => categoryIndex.includes(el))} }).flat().every(el => categoryIndex.includes(el))}
label="Remix" label="Remix"
onClick={() => { onClick={() => {
handleBasicEnabled()
handleCheckAllModules(groupedModules) handleCheckAllModules(groupedModules)
}} }}
onChange={() => {}} onChange={() => {}}

Loading…
Cancel
Save