diff --git a/plugin/src/features/Compilation/index.tsx b/plugin/src/features/Compilation/index.tsx index ce932650..9fdb2948 100644 --- a/plugin/src/features/Compilation/index.tsx +++ b/plugin/src/features/Compilation/index.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { useAtom, useAtomValue, useSetAtom } from 'jotai' +import { useAtomValue, useSetAtom } from 'jotai' import { artifactFolder } from '@/utils/utils' import Container from '../../ui_components/Container' import { type AccordianTabs } from '../Plugin' @@ -30,7 +30,7 @@ export const Compilation: React.FC = ({ setAccordian }) => { const activeTomlPath = useAtomValue(activeTomlPathAtom) const currentWorkspacePath = useAtomValue(currentWorkspacePathAtom) - const [contracts, setContracts] = useAtom(contractsAtom) + const setContracts = useSetAtom(contractsAtom) const setSelectedContract = useSetAtom(selectedContractAtom) const { status, isCompiling } = useAtomValue(compilationAtom) @@ -165,7 +165,7 @@ export const Compilation: React.FC = ({ setAccordian }) => { contractsToAdd.push(contract) } - setContracts([...contractsToAdd, ...contracts]) + setContracts(contractsToAdd) setSelectedContract(contractsToAdd[0]) for (const file of compileResult.file_content) {