From f9dc2da0c42452fe885638a4ef49933374f8e3dd Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Mon, 30 Jan 2023 16:31:37 +0100 Subject: [PATCH] fix learnEth button --- .../home-tab/src/lib/components/homeTabLearn.tsx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/libs/remix-ui/home-tab/src/lib/components/homeTabLearn.tsx b/libs/remix-ui/home-tab/src/lib/components/homeTabLearn.tsx index 30f2332346..1765452d80 100644 --- a/libs/remix-ui/home-tab/src/lib/components/homeTabLearn.tsx +++ b/libs/remix-ui/home-tab/src/lib/components/homeTabLearn.tsx @@ -34,11 +34,23 @@ function HomeTabLearn ({plugin}: HomeTabLearnProps) { const startLearnEthTutorial = async (tutorial: 'home' | 'basics' | 'soliditybeginner' | 'deploylibraries') => { await plugin.appManager.activatePlugin(['solidity', 'LearnEth', 'solidityUnitTesting']) plugin.verticalIcons.select('LearnEth') - tutorial === 'home' ? plugin.call('LearnEth') : + tutorial === 'home' ? plugin.call('LearnEth', 'home') : plugin.call('LearnEth', 'startTutorial', 'ethereum/remix-workshops', 'master', tutorial) _paq.push(['trackEvent', 'hometab', 'startLearnEthTutorial', tutorial]) } + const goToLearnEthHome = async () => { + console.log({ plugin }) + if(plugin.appManager.isActive('LearnEth')) { + plugin.verticalIcons.select('LearnEth') + await plugin.call('LearnEth', 'home') + } else { + await plugin.appManager.activatePlugin(['learnEth', 'solidity', 'solidityUnitTesting']) + plugin.verticalIcons.select('LearnEth') + await plugin.call('LearnEth', 'home') + } + } + return (
@@ -47,7 +59,7 @@ function HomeTabLearn ({plugin}: HomeTabLearnProps) {