react 18 fix misc

pull/4355/head
yann300 11 months ago
parent 472bab80e4
commit a6c68559b2
  1. 4
      apps/remix-ide/src/app/plugins/parser/services/code-parser-compiler.ts
  2. 3
      apps/remix-ide/src/app/tabs/test-tab.js
  3. 3
      libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx

@ -48,7 +48,7 @@ export default class CodeParserCompiler {
init() {
this.onAstFinished = async (success, data: CompilationResult, source: CompilationSourceCode, input: any, version) => {
this.plugin.call('editor', 'clearAnnotations')
await this.plugin.call('editor', 'clearAnnotations')
this.errorState = true
const result = new CompilerAbstract('soljson', data, source, input)
let allErrors: errorMarker[] = []
@ -93,7 +93,7 @@ export default class CodeParserCompiler {
const displayErrors = await this.plugin.call('config', 'getAppParameter', 'display-errors')
if (displayErrors) await this.plugin.call('editor', 'addErrorMarker', allErrors)
this.addDecorators(allErrors, sources)
await this.addDecorators(allErrors, sources)
} else {
await this.plugin.call('editor', 'clearErrorMarkers', result.getSourceCode().sources)
await this.clearDecorators(result.getSourceCode().sources)

@ -81,13 +81,14 @@ module.exports = class TestTab extends ViewPlugin {
onDeactivation () {
this.off('filePanel', 'newTestFileCreated')
this.off('filePanel', 'setWorkspace')
this.off('filePanel', 'workspaceCreated')
// 'currentFileChanged' event is added more than once
this.fileManager.events.removeAllListeners('currentFileChanged')
}
listenToEvents () {
this.on('filePanel', 'workspaceCreated', async () => {
this.createTestLibs()
setTimeout(() => this.createTestLibs(), 50)
})
this.testRunner.event.on('compilationFinished', (success, data, source, input, version) => {

@ -165,8 +165,7 @@ export const SolidityUnitTesting = (props: Record<string, any>) => {
})
testTab.on('filePanel', 'workspaceCreated', async () => {
setTimeout(async () => {
await setCurrentPath(defaultPath)}, 100)
setTimeout(async () => await setCurrentPath(defaultPath), 100)
})
testTab.on('filePanel', 'setWorkspace', async () => {

Loading…
Cancel
Save