From 076e09f0475aba3a3ac10873eaff8b6004c1e9ae Mon Sep 17 00:00:00 2001 From: Jeremy Theintz Date: Wed, 6 Jul 2022 13:44:38 +0200 Subject: [PATCH] add calls param to iframe call multiple functions on start --- apps/remix-ide/src/app.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/apps/remix-ide/src/app.js b/apps/remix-ide/src/app.js index d9c93fd4f6..a7673d45bc 100644 --- a/apps/remix-ide/src/app.js +++ b/apps/remix-ide/src/app.js @@ -410,6 +410,25 @@ class AppComponent { this.appManager.call(...callDetails).catch(console.error) } } + + if (params.calls) { + const calls = params.calls.split("///"); + + // call all functions in the list, one after the other + for (const call of calls) { + const callDetails = call.split("//"); + if (callDetails.length > 1) { + this.appManager.call( + "notification", + "toast", + `initiating ${callDetails[0]} ...` + ); + + // @todo(remove the timeout when activatePlugin is on 0.3.0) + await this.appManager.call(...callDetails).catch(console.error); + } + } + } }) .catch(console.error) }