From 121b0b3eb47edec441fdf80286430247bc989ad7 Mon Sep 17 00:00:00 2001 From: Thigazhezhilan J Date: Fri, 27 Mar 2026 22:48:14 +0530 Subject: [PATCH] Hide reconnect action for valid broker sessions --- src/components/landing/PortfolioSection.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/landing/PortfolioSection.tsx b/src/components/landing/PortfolioSection.tsx index 6343b8ce..9e898126 100644 --- a/src/components/landing/PortfolioSection.tsx +++ b/src/components/landing/PortfolioSection.tsx @@ -569,6 +569,8 @@ export default function PortfolioSection() { const equityCurve = equityCurveQuery.data ?? cachedEquityCurve; const equityCurvePoints = equityCurve?.points ?? []; const showSessionExpired = sessionExpired && isConnected; + const brokerAuthExpired = (brokerStatus?.authState || "").toUpperCase() === "EXPIRED"; + const showReconnectBroker = isConnected && (showSessionExpired || brokerAuthExpired); const normalizedStrategyStatus = strategyStatus === "RUNNING" ? "RUNNING" : "STOPPED"; @@ -681,7 +683,7 @@ export default function PortfolioSection() { setConnectPromptOpen(true); return; } - if (showSessionExpired || (brokerStatus?.authState || "").toUpperCase() === "EXPIRED") { + if (showSessionExpired || brokerAuthExpired) { toast({ title: "Reconnect broker", description: "Your Zerodha session has expired. Reconnect before starting the live strategy.", @@ -890,7 +892,7 @@ export default function PortfolioSection() { : "Refresh data"} ) : null} - {isConnected ? ( + {showReconnectBroker ? (