From 5ced5f445c48311cd5560e08851a6e31286ac871 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 7 Mar 2022 11:37:18 +0100 Subject: [PATCH] fix linting --- .../solidity-compiler/src/app/compiler-api.ts | 28 +++++++++++-------- .../settings/src/lib/remix-ui-settings.tsx | 2 +- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/apps/solidity-compiler/src/app/compiler-api.ts b/apps/solidity-compiler/src/app/compiler-api.ts index 63e44e50fe..caeda11d1d 100644 --- a/apps/solidity-compiler/src/app/compiler-api.ts +++ b/apps/solidity-compiler/src/app/compiler-api.ts @@ -261,15 +261,20 @@ export const CompilerApiMixin = (Base) => class extends Base { this.on('fileManager', 'fileClosed', this.data.eventHandlers.onFileClosed) + let postCompilationAction this.on('compilerMetadata', 'artefactsUpdated', async () => { - if (!await this.getAppParameter('live-mode')) return - const path = await this.getAppParameter('live-mode-script') - if (path) { - await this.call('terminal', 'log', `running ${path} ...`) - const content = await this.call('fileManager', 'readFile', path) - await this.call('udapp', 'clearAllInstances') - this.call('scriptRunner', 'execute', content) + if (postCompilationAction === 69) { + postCompilationAction = null + if (!await this.getAppParameter('live-mode')) return + const path = await this.getAppParameter('live-mode-script') + if (path) { + await this.call('terminal', 'log', `running ${path} ...`) + const content = await this.call('fileManager', 'readFile', path) + await this.call('udapp', 'clearAllInstances') + this.call('scriptRunner', 'execute', content) + } } + postCompilationAction = null }) this.data.eventHandlers.onCompilationFinished = async (success, data, source, input, version) => { @@ -318,15 +323,14 @@ export const CompilerApiMixin = (Base) => class extends Base { this.data.eventHandlers.onKeyDown = async (e) => { if ((e.metaKey || e.ctrlKey) && e.keyCode === 83 && this.currentFile && this.currentFile.endsWith('.sol')) { // ctrl+s or command+s + postCompilationAction = e.keyCode e.preventDefault() this.compileTabLogic.runCompiler(await this.getAppParameter('hardhat-compilation')) - } else if ((e.metaKey || e.ctrlKey) && e.keyCode === 69 && this.currentFile && this.currentFile.endsWith('.js')) { + } else if ((e.metaKey || e.ctrlKey) && e.keyCode === 69 && this.currentFile && this.currentFile.endsWith('.sol')) { // ctrl+e or command+e + postCompilationAction = e.keyCode e.preventDefault() - this.call('terminal', 'log', `running ${this.currentFile} ...`) - const content = await this.call('fileManager', 'readFile', this.currentFile) - await this.call('udapp', 'clearAllInstances') - this.call('scriptRunner', 'execute', content) + this.compileTabLogic.runCompiler(await this.getAppParameter('hardhat-compilation')) } } window.document.addEventListener('keydown', this.data.eventHandlers.onKeyDown) diff --git a/libs/remix-ui/settings/src/lib/remix-ui-settings.tsx b/libs/remix-ui/settings/src/lib/remix-ui-settings.tsx index 0f946eb494..35b06269ff 100644 --- a/libs/remix-ui/settings/src/lib/remix-ui-settings.tsx +++ b/libs/remix-ui/settings/src/lib/remix-ui-settings.tsx @@ -1,7 +1,7 @@ import React, { useState, useReducer, useEffect, useCallback } from 'react' // eslint-disable-line import { CopyToClipboard } from '@remix-ui/clipboard' // eslint-disable-line -import { enablePersonalModeText, ethereunVMText, labels, generateContractMetadataText, matomoAnalytics, textDark, textSecondary, warnText, wordWrapText, swarmSettingsTitle, liveModeSettingsText, liveModeText, liveModeText2, liveModeText4, liveModeText3, liveModeText5, liveModeSettingsTitle } from './constants' +import { enablePersonalModeText, ethereunVMText, labels, generateContractMetadataText, matomoAnalytics, textDark, textSecondary, warnText, wordWrapText, swarmSettingsTitle, liveModeText, liveModeText2, liveModeText4, liveModeText3, liveModeText5, liveModeSettingsTitle } from './constants' import './remix-ui-settings.css' import { ethereumVM, generateContractMetadat, liveMode, personal, textWrapEventAction, useMatomoAnalytics, saveTokenToast, removeTokenToast, saveSwarmSettingsToast } from './settingsAction'