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) { if (provider) {
try{ try{
const content = await provider.get(currentFile) const content = await provider.get(currentFile)
this.editor.setText(content) if(content) this.editor.setText(content)
}catch(error){ }catch(error){
console.log(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') if (!this._isReady) return cb && cb('provider not ready')
var unprefixedpath = this.removePrefix(path) var unprefixedpath = this.removePrefix(path)
this._appManager.call('remixd', 'get', { path: unprefixedpath }) try{
.then((file) => { const file = await this._appManager.call('remixd', 'get', { path: unprefixedpath })
this.filesContent[path] = file.content this.filesContent[path] = file.content
if (file.readonly) { this._readOnlyFiles[path] = 1 } if (file.readonly) { this._readOnlyFiles[path] = 1 }
cb(null, file.content) if(cb) cb(null, file.content)
}).catch((error) => { return file.content
if (error) console.log(error) } catch(error) {
// display the last known content. if (error) console.log(error)
// TODO should perhaps better warn the user that the file is not synced. if(cb) return cb(null, this.filesContent[path])
return cb(null, this.filesContent[path]) }
})
} }
async set (path, content, cb) { async set (path, content, cb) {

@ -544,7 +544,7 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
) )
} else { } else {
return ( 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