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