diff --git a/apps/remix-ide/src/app/tabs/locales/en/udapp.json b/apps/remix-ide/src/app/tabs/locales/en/udapp.json index 7ebb3b8605..c0103f9d44 100644 --- a/apps/remix-ide/src/app/tabs/locales/en/udapp.json +++ b/apps/remix-ide/src/app/tabs/locales/en/udapp.json @@ -85,6 +85,7 @@ "udapp.solScan.modalMessage": "Contract code will be shared to third party Solidity Scan.\n Would you like to continue?", "udapp.solScan.modalOkLabel": "Continue", "udapp.solScan.modalCancelLabel": "Cancel", + "udapp.solScan.errModalTitle": "Error", "udapp._comment_recorderCardUI.tsx": "libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx", "udapp.transactionsRecorded": "Transactions recorded", diff --git a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx index edc81f737c..30541b2944 100644 --- a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx @@ -220,6 +220,7 @@ export function UniversalDappUI(props: UdappProps) { } const handleScanContinue = async () => { + await props.plugin.call('notification', 'toast', 'Running scan...') const workspace = await props.plugin.call('filePanel', 'getCurrentWorkspace') const fileName = props.instance.filePath || `${workspace.name}/${props.instance.contractData.contract.file}` // const existsOrNot = await props.plugin.call('fileManager', 'exists', fileName) @@ -270,10 +271,10 @@ export function UniversalDappUI(props: UdappProps) { ws.addEventListener('error', console.error); ws.addEventListener('open', (event) => { - console.log('Connected to the server.') + console.log('Connected to the solidityscan server.') }) - ws.addEventListener('message', (event) => { + ws.addEventListener('message', async (event) => { const data = JSON.parse(event.data) if (data.type === "auth_token_register" && data.payload.message === "Auth token registered.") { const reqToInitScan = { @@ -290,6 +291,14 @@ export function UniversalDappUI(props: UdappProps) { } } ws.send(JSON.stringify(reqToInitScan)) + } else if (data.type === "scan_status" && data.payload.scan_status === "download_failed") { + const modal: AppModal = { + id: 'SolidityScanError', + title: , + message: data.payload.scan_status_err_message, + okLabel: 'Close' + } + await props.plugin.call('notification', 'modal', modal) } }) @@ -304,11 +313,10 @@ export function UniversalDappUI(props: UdappProps) { message: , okLabel: , okFn: handleScanContinue, - cancelLabel: + cancelLabel: , } - const result = await props.plugin.call('notification', 'modal', modal) - console.log('askPermissionToScan----> result----->', result) + await props.plugin.call('notification', 'modal', modal) } const label = (key: string | number, value: string) => {