Skip to content

Commit

Permalink
ux and text update
Browse files Browse the repository at this point in the history
  • Loading branch information
Aniket-Engg committed Dec 20, 2024
1 parent f6bcb94 commit 5ed42a3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 17 deletions.
6 changes: 3 additions & 3 deletions apps/remix-dapp/src/locales/en/udapp.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@
"udapp.signature": "signature",
"udapp.saveVmStateTitle": "Save VM state",
"udapp.saveVmStateLabel": "State Name",
"udapp.saveVmStateTip": "Saved VM states can be pinned as environment using Environment Explorer",
"udapp.saveVmStateTip": "VM state, saved for current workspace, can be pinned as an environment using Environment Explorer",
"udapp.resetVmStateTitle": "Reset VM state",
"udapp.resetVmStateDesc1": "Resetting state of selected environment will delete all your previously saved transaction details for selected workspace.",
"udapp.resetVmStateDesc2": "It will also delete data for deployed and pinned contracts.",
"udapp.resetVmStateDesc1": "Resetting state of the selected environment will delete all your previously saved transaction details for current workspace.",
"udapp.resetVmStateDesc2": "It will also delete the data for contracts deployed and pinned for this workspace.",
"udapp.resetVmStateDesc3": "Do you want to continue?",
"udapp.reset": "Reset",
"udapp.injectedTitle": "Unfortunately it's not possible to create an account using injected provider. Please create the account directly from your provider (i.e metamask or other of the same type).",
Expand Down
6 changes: 3 additions & 3 deletions apps/remix-ide/src/app/tabs/locales/en/udapp.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@
"udapp.signature": "signature",
"udapp.saveVmStateTitle": "Save VM state",
"udapp.saveVmStateLabel": "State Name",
"udapp.saveVmStateTip": "Saved VM states can be pinned as environment using Environment Explorer",
"udapp.saveVmStateTip": "VM state, saved for current workspace, can be pinned as an environment using Environment Explorer",
"udapp.resetVmStateTitle": "Reset VM state",
"udapp.resetVmStateDesc1": "Resetting state of selected environment will delete all your previously saved transaction details for selected workspace.",
"udapp.resetVmStateDesc2": "It will also delete data for deployed and pinned contracts.",
"udapp.resetVmStateDesc1": "Resetting state of the selected environment will delete all your previously saved transaction details for current workspace.",
"udapp.resetVmStateDesc2": "It will also delete the data for contracts deployed and pinned for this workspace.",
"udapp.resetVmStateDesc3": "Do you want to continue?",
"udapp.injectedTitle": "Unfortunately it's not possible to create an account using injected provider. Please create the account directly from your provider (i.e metamask or other of the same type).",
"udapp.createNewAccount": "Create new account",
Expand Down
23 changes: 12 additions & 11 deletions libs/remix-ui/run-tab/src/lib/components/environment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ export function EnvironmentUI(props: EnvironmentProps) {
)
}

const resetVmStatePrompt = (context: string) => {
const resetVmStatePrompt = () => {
return (
<div>
<div>
<FormattedMessage id="udapp.resetVmStateDesc1"/><br/>
<FormattedMessage id="udapp.resetVmStateDesc2"/><br/><br/>
<FormattedMessage id="udapp.resetVmStateDesc3"/>
</div>
<ul className='ml-3'>
<li><FormattedMessage id="udapp.resetVmStateDesc1"/></li>
<li><FormattedMessage id="udapp.resetVmStateDesc2"/></li>
</ul>
<FormattedMessage id="udapp.resetVmStateDesc3"/>
</div>
)
}
Expand Down Expand Up @@ -91,19 +91,20 @@ export function EnvironmentUI(props: EnvironmentProps) {
if (contextExists) {
props.modal(
intl.formatMessage({ id: 'udapp.resetVmStateTitle' }),
resetVmStatePrompt(context),
resetVmStatePrompt(),
intl.formatMessage({ id: 'udapp.reset' }),
async () => {
const currentProvider = await props.runTabPlugin.call('blockchain', 'getCurrentProvider')
// Reset environment blocks and account data
currentProvider.resetEnvironment()
await currentProvider.resetEnvironment()
// Remove deployed and pinned contracts from UI
props.runTabPlugin.REACT_API.instances.instanceList = {}
// Delete environment state file
await props.runTabPlugin.call('fileManager', 'remove', `.states/${context}/state.json`)
// Delete pinned contracts folder
await props.runTabPlugin.call('fileManager', 'remove', `.deploys/pinned-contracts/${context}`)
props.runTabPlugin.call('notification', 'toast', `VM state reset successfully`)
// If there are pinned contracts, delete pinned contracts folder
const isPinnedContracts = await props.runTabPlugin.call('fileManager', 'exists', `.deploys/pinned-contracts/${context}`)
if(isPinnedContracts) await props.runTabPlugin.call('fileManager', 'remove', `.deploys/pinned-contracts/${context}`)
props.runTabPlugin.call('notification', 'toast', `VM state reset successfully.`)
},
intl.formatMessage({ id: 'udapp.cancel' }),
null
Expand Down

0 comments on commit 5ed42a3

Please sign in to comment.