From 0e37f712b25e574b07f4079a4f301136ced1e6d2 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 6 Mar 2023 12:20:58 +0100 Subject: [PATCH 1/4] trim github token --- libs/remix-ui/settings/src/lib/github-settings.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/remix-ui/settings/src/lib/github-settings.tsx b/libs/remix-ui/settings/src/lib/github-settings.tsx index 134b967230..5a873290d7 100644 --- a/libs/remix-ui/settings/src/lib/github-settings.tsx +++ b/libs/remix-ui/settings/src/lib/github-settings.tsx @@ -25,7 +25,8 @@ export function GithubSettings (props: GithubSettingsProps) { }, [props.config]) const handleChangeTokenState = (event) => { - setGithubToken(event.target.value) + const token = event.target.value ? event.target.value.trim() : event.target.value + setGithubToken(token) } const handleChangeUserNameState = (event) => { From 8fb925efd2ef3ca7c9614c2a805cac7d9b7401b9 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 6 Mar 2023 12:22:15 +0100 Subject: [PATCH 2/4] use second opt arg in "execute" --- apps/remix-ide/src/app/tabs/compile-and-run.ts | 2 +- libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide/src/app/tabs/compile-and-run.ts b/apps/remix-ide/src/app/tabs/compile-and-run.ts index a8ce143125..bfe6cda981 100644 --- a/apps/remix-ide/src/app/tabs/compile-and-run.ts +++ b/apps/remix-ide/src/app/tabs/compile-and-run.ts @@ -62,7 +62,7 @@ export class CompileAndRun extends Plugin { if (clearAllInstances) { await this.call('udapp', 'clearAllInstances') } - await this.call('scriptRunner', 'execute', content) + await this.call('scriptRunner', 'execute', content, fileName) } catch (e) { this.call('notification', 'toast', e.message || e) } diff --git a/libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx b/libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx index 9102ffda48..d20a9b488c 100644 --- a/libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx +++ b/libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx @@ -153,7 +153,7 @@ export const TabsUI = (props: TabsUIProps) => { const path = active().substr(active().indexOf('/') + 1, active().length) const content = await props.plugin.call('fileManager', "readFile", path) if (tabsState.currentExt === 'js' || tabsState.currentExt === 'ts') { - await props.plugin.call('scriptRunner', 'execute', content) + await props.plugin.call('scriptRunner', 'execute', content, path) _paq.push(['trackEvent', 'editor', 'clickRunFromEditor', tabsState.currentExt]) } else if (tabsState.currentExt === 'sol' || tabsState.currentExt === 'yul') { await props.plugin.call('solidity', 'compile', path) From 8f3352bd78913719a69c0509dddf0083d8b00006 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 6 Mar 2023 12:33:12 +0100 Subject: [PATCH 3/4] Revert "use second opt arg in "execute"" This reverts commit 8fb925efd2ef3ca7c9614c2a805cac7d9b7401b9. --- apps/remix-ide/src/app/tabs/compile-and-run.ts | 2 +- libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide/src/app/tabs/compile-and-run.ts b/apps/remix-ide/src/app/tabs/compile-and-run.ts index bfe6cda981..a8ce143125 100644 --- a/apps/remix-ide/src/app/tabs/compile-and-run.ts +++ b/apps/remix-ide/src/app/tabs/compile-and-run.ts @@ -62,7 +62,7 @@ export class CompileAndRun extends Plugin { if (clearAllInstances) { await this.call('udapp', 'clearAllInstances') } - await this.call('scriptRunner', 'execute', content, fileName) + await this.call('scriptRunner', 'execute', content) } catch (e) { this.call('notification', 'toast', e.message || e) } diff --git a/libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx b/libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx index d20a9b488c..9102ffda48 100644 --- a/libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx +++ b/libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx @@ -153,7 +153,7 @@ export const TabsUI = (props: TabsUIProps) => { const path = active().substr(active().indexOf('/') + 1, active().length) const content = await props.plugin.call('fileManager', "readFile", path) if (tabsState.currentExt === 'js' || tabsState.currentExt === 'ts') { - await props.plugin.call('scriptRunner', 'execute', content, path) + await props.plugin.call('scriptRunner', 'execute', content) _paq.push(['trackEvent', 'editor', 'clickRunFromEditor', tabsState.currentExt]) } else if (tabsState.currentExt === 'sol' || tabsState.currentExt === 'yul') { await props.plugin.call('solidity', 'compile', path) From 01613c4616efcbf0e738afe89e76dd8748a32079 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 6 Mar 2023 12:33:23 +0100 Subject: [PATCH 4/4] Revert "trim github token" This reverts commit 0e37f712b25e574b07f4079a4f301136ced1e6d2. --- libs/remix-ui/settings/src/lib/github-settings.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libs/remix-ui/settings/src/lib/github-settings.tsx b/libs/remix-ui/settings/src/lib/github-settings.tsx index 5a873290d7..134b967230 100644 --- a/libs/remix-ui/settings/src/lib/github-settings.tsx +++ b/libs/remix-ui/settings/src/lib/github-settings.tsx @@ -25,8 +25,7 @@ export function GithubSettings (props: GithubSettingsProps) { }, [props.config]) const handleChangeTokenState = (event) => { - const token = event.target.value ? event.target.value.trim() : event.target.value - setGithubToken(token) + setGithubToken(event.target.value) } const handleChangeUserNameState = (event) => {