|
|
|
@ -8,6 +8,7 @@ import { UniversalDappUI } from './universalDappUI' |
|
|
|
|
export function InstanceContainerUI(props: InstanceContainerProps) { |
|
|
|
|
const { instanceList } = props.instances |
|
|
|
|
const enableSave = useRef(false) |
|
|
|
|
const chainId = useRef() |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
const fetchSavedContracts = async () => { |
|
|
|
@ -19,6 +20,7 @@ export function InstanceContainerUI(props: InstanceContainerProps) { |
|
|
|
|
await props.plugin.call('udapp', 'clearAllSavedInstances') |
|
|
|
|
const savedContracts = JSON.parse(allSavedContracts) |
|
|
|
|
const { network } = await props.plugin.call('blockchain', 'getCurrentNetworkStatus') |
|
|
|
|
chainId.current = network.id |
|
|
|
|
if (savedContracts && savedContracts[network.id]) { |
|
|
|
|
const instances = savedContracts[network.id] |
|
|
|
|
for (const inst of instances) |
|
|
|
@ -40,7 +42,8 @@ export function InstanceContainerUI(props: InstanceContainerProps) { |
|
|
|
|
<div className="d-flex justify-content-between align-items-center pl-2"> |
|
|
|
|
<CustomTooltip placement="top-start" tooltipClasses="text-nowrap" tooltipId="deployAndRunPinnedContractsTooltip" tooltipText={<FormattedMessage id="udapp.tooltipTextPinnedContracts" />}> |
|
|
|
|
<label className="udapp_deployedContracts"> |
|
|
|
|
<FormattedMessage id="udapp.savedContracts" /> |
|
|
|
|
<FormattedMessage id="udapp.savedContracts" />
|
|
|
|
|
<span style={{fontSize: '0.75rem'}}> (chain id: {chainId.current})</span> |
|
|
|
|
</label> |
|
|
|
|
</CustomTooltip> |
|
|
|
|
</div>) : null } |
|
|
|
|