From f81e661b2b1aae9179e0280db1f8b7f37f4842a7 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Thu, 24 Feb 2022 11:22:54 +0100 Subject: [PATCH 1/4] rm comma rm --- libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx b/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx index 73b5b3e424..1e99f8583a 100644 --- a/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx +++ b/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx @@ -544,7 +544,7 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => { ) } else { return ( -
{ msg ? msg.toString().replace(/,/g, '') : msg }
+
{msg}
) } }) From 047836d7735c42ab4a047e85c7c711c57cfc14f4 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Thu, 24 Feb 2022 12:19:09 +0100 Subject: [PATCH 2/4] fix async method --- apps/remix-ide/src/app/files/fileManager.ts | 2 +- .../remix-ide/src/app/files/remixDProvider.js | 23 +++++++++---------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/apps/remix-ide/src/app/files/fileManager.ts b/apps/remix-ide/src/app/files/fileManager.ts index 5ac6f8dd30..9c11b5863d 100644 --- a/apps/remix-ide/src/app/files/fileManager.ts +++ b/apps/remix-ide/src/app/files/fileManager.ts @@ -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) } diff --git a/apps/remix-ide/src/app/files/remixDProvider.js b/apps/remix-ide/src/app/files/remixDProvider.js index a36b6d8ec9..0e8f1223cf 100644 --- a/apps/remix-ide/src/app/files/remixDProvider.js +++ b/apps/remix-ide/src/app/files/remixDProvider.js @@ -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) return 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) { From 51b8bd6814d2e1a205f08e0343223b77a6f5fc80 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Thu, 24 Feb 2022 12:35:02 +0100 Subject: [PATCH 3/4] fix msg string --- libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx b/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx index 1e99f8583a..904685f7a5 100644 --- a/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx +++ b/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx @@ -544,7 +544,7 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => { ) } else { return ( -
{msg}
+
{msg? msg.toString() : null}
) } }) From 73472bba9f49673489998fed223ab44f630730fb Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Thu, 24 Feb 2022 12:45:15 +0100 Subject: [PATCH 4/4] Update remixDProvider.js --- apps/remix-ide/src/app/files/remixDProvider.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide/src/app/files/remixDProvider.js b/apps/remix-ide/src/app/files/remixDProvider.js index 0e8f1223cf..c52055e04f 100644 --- a/apps/remix-ide/src/app/files/remixDProvider.js +++ b/apps/remix-ide/src/app/files/remixDProvider.js @@ -105,7 +105,7 @@ module.exports = class RemixDProvider extends FileProvider { const file = await this._appManager.call('remixd', 'get', { path: unprefixedpath }) this.filesContent[path] = file.content if (file.readonly) { this._readOnlyFiles[path] = 1 } - if(cb) return cb(null, file.content) + if(cb) cb(null, file.content) return file.content } catch(error) { if (error) console.log(error)