show chain id

pull/4599/head^2
aniket-engg 9 months ago committed by Aniket
parent 6631beacb5
commit 532abddf8b
  1. 2
      apps/remix-ide/src/app/tabs/locales/en/udapp.json
  2. 3
      libs/remix-ui/run-tab/src/lib/components/instanceContainerUI.tsx

@ -72,7 +72,7 @@
"udapp.savedContracts": "Pinned Contracts", "udapp.savedContracts": "Pinned Contracts",
"udapp.tooltipTextPinnedContracts": "List of pinned contracts for selected network", "udapp.tooltipTextPinnedContracts": "List of pinned contracts for selected network",
"udapp.NoSavedInstanceText": "No contracts pinned yet. Pinned contracts stays after reloading Remix IDE.", "udapp.NoSavedInstanceText": "No contracts pinned yet. Pinned contracts stay after reloading Remix IDE.",
"udapp.tooltipTextDelete": "Delete pinned contract", "udapp.tooltipTextDelete": "Delete pinned contract",
"udapp.tooltipTextUnpin": "Unpin contract", "udapp.tooltipTextUnpin": "Unpin contract",
"udapp.savedOn": "Pinned On", "udapp.savedOn": "Pinned On",

@ -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 }

Loading…
Cancel
Save