Merge branch 'master' into search

pull/2092/head
bunsenstraat 3 years ago committed by GitHub
commit 23f589c98c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      apps/remix-ide/src/app/files/fileManager.ts
  2. 23
      apps/remix-ide/src/app/files/remixDProvider.js
  3. 2
      libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx

@ -752,7 +752,7 @@ class FileManager extends Plugin {
if (provider) {
try{
const content = await provider.get(currentFile)
this.editor.setText(content)
if(content) this.editor.setText(content)
}catch(error){
console.log(error)
}

@ -98,20 +98,19 @@ module.exports = class RemixDProvider extends FileProvider {
})
}
get (path, cb) {
async get (path, cb) {
if (!this._isReady) return cb && cb('provider not ready')
var unprefixedpath = this.removePrefix(path)
this._appManager.call('remixd', 'get', { path: unprefixedpath })
.then((file) => {
this.filesContent[path] = file.content
if (file.readonly) { this._readOnlyFiles[path] = 1 }
cb(null, file.content)
}).catch((error) => {
if (error) console.log(error)
// display the last known content.
// TODO should perhaps better warn the user that the file is not synced.
return cb(null, this.filesContent[path])
})
try{
const file = await this._appManager.call('remixd', 'get', { path: unprefixedpath })
this.filesContent[path] = file.content
if (file.readonly) { this._readOnlyFiles[path] = 1 }
if(cb) cb(null, file.content)
return file.content
} catch(error) {
if (error) console.log(error)
if(cb) return cb(null, this.filesContent[path])
}
}
async set (path, content, cb) {

@ -544,7 +544,7 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
)
} else {
return (
<div className={classNameBlock} data-id="block" key={i}><span className={x.style}>{ msg ? msg.toString().replace(/,/g, '') : msg }</span></div>
<div className={classNameBlock} data-id="block" key={i}><span className={x.style}>{msg? msg.toString() : null}</span></div>
)
}
})

Loading…
Cancel
Save