fix loading

pull/4538/head
aniket-engg 9 months ago committed by Aniket
parent a2eadb10f1
commit 168f52877c
  1. 9
      libs/remix-ui/run-tab/src/lib/components/instanceContainerUI.tsx
  2. 6
      libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx
  3. 1
      libs/remix-ui/run-tab/src/lib/types/index.ts

@ -15,17 +15,15 @@ export function InstanceContainerUI(props: InstanceContainerProps) {
if (allSavedContracts) {
const savedContracts = JSON.parse(allSavedContracts)
const { network } = await props.plugin.call('blockchain', 'getCurrentNetworkStatus')
network.id = network.id.trim() // For VM, id is ' - '
if(network.id === ' - ') network.id = network.id.trim() // For VM, id is ' - '
const env = await props.plugin.call('blockchain', 'getProvider')
if (savedContracts[env] && savedContracts[env][network.id]) {
savedContractForCurrentEnv.current = savedContracts[env][network.id]
}
}
}
fetchSavedContracts()
}, [])
}, [props.plugin.REACT_API.networkName])
const clearInstance = () => {
props.clearInstances()
@ -50,6 +48,7 @@ export function InstanceContainerUI(props: InstanceContainerProps) {
<UniversalDappUI
key={index}
instance={instance}
isSavedContract={true}
context={props.getContext()}
removeInstance={props.removeInstance}
index={index}
@ -70,7 +69,7 @@ export function InstanceContainerUI(props: InstanceContainerProps) {
</span>
)}
<div className="d-flex justify-content-between align-items-center pl-2 mb-2">
<div className="d-flex justify-content-between align-items-center pl-2 mb-2 mt-3">
<CustomTooltip placement="top-start" tooltipClasses="text-nowrap" tooltipId="deployAndRunClearInstancesTooltip" tooltipText={<FormattedMessage id="udapp.tooltipText6" />}>
<label className="udapp_deployedContracts">
<FormattedMessage id="udapp.deployedContracts" />

@ -136,7 +136,7 @@ export function UniversalDappUI(props: UdappProps) {
}
}
objToSave[env][network.id].push(props.instance)
localStorage.setItem('savedContracts', JSON.stringify(objToSave))
localStorage.setItem('savedContracts', JSON.stringify({ instance: objToSave, savedAt: Date.now()}))
}
const runTransaction = (lookupOnly, funcABI: FuncABI, valArr, inputsValues, funcIndex?: number) => {
@ -254,11 +254,11 @@ export function UniversalDappUI(props: UdappProps) {
<div className="btn" style={{padding: '0.15rem'}}>
<CopyToClipboard tip={intl.formatMessage({id: 'udapp.copy'})} content={address} direction={'top'} />
</div>
<div className="btn" style={{padding: '0.15rem', marginLeft: '-0.5rem'}}>
{ !props.isSavedContract ? ( <div className="btn" style={{padding: '0.15rem', marginLeft: '-0.5rem'}}>
<CustomTooltip placement="top" tooltipClasses="text-nowrap" tooltipId="udapp_udappSaveTooltip" tooltipText={<FormattedMessage id="udapp.tooltipText14" />}>
<i className="far fa-save p-2" aria-hidden="true" data-id="universalDappUiUdappSave" onClick={saveContract}></i>
</CustomTooltip>
</div>
</div> ) : null }
</div>
<CustomTooltip placement="right" tooltipClasses="text-nowrap" tooltipId="udapp_udappCloseTooltip" tooltipText={<FormattedMessage id="udapp.tooltipText7" />}>

@ -399,6 +399,7 @@ export interface UdappProps {
abi?: any
},
context: 'memory' | 'blockchain',
isSavedContract?: boolean
removeInstance: (index: number) => void,
index: number,
gasEstimationPrompt: (msg: string) => JSX.Element,

Loading…
Cancel
Save