From da3495a87f4d545cfe938431cee306ea3a39bc40 Mon Sep 17 00:00:00 2001 From: Jeffin joffy <114131523+Apetun@users.noreply.github.com> Date: Sun, 14 Jul 2024 13:26:44 +0530 Subject: [PATCH] Update Tabs.jsx --- frontend/src/Editor/Components/Tabs.jsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/frontend/src/Editor/Components/Tabs.jsx b/frontend/src/Editor/Components/Tabs.jsx index fd490fd312..c65deab6c8 100644 --- a/frontend/src/Editor/Components/Tabs.jsx +++ b/frontend/src/Editor/Components/Tabs.jsx @@ -95,10 +95,11 @@ export const Tabs = function Tabs({ useEffect(() => { const exposedVariables = { setTab: async function (id) { - if (id) { - setCurrentTab(id); - setExposedVariable('currentTab', id); - fireEvent('onTabSwitch'); + if (id !== undefined) { + const tabId = Number(id); + setCurrentTab(tabId); + setExposedVariable('currentTab', tabId); + fireEvent('onTabSwitch') } }, currentTab: currentTab,