From ebc2b7b77d91569d85975ce79031d0fc24a6075a Mon Sep 17 00:00:00 2001 From: tusharmagar Date: Mon, 16 Mar 2026 22:07:32 +0530 Subject: [PATCH] Refactor voice availability check in App component to trigger on OAuth state changes. Update SidebarContentPanel to enhance billing display with improved styling and clearer upgrade call-to-action. --- apps/x/apps/renderer/src/App.tsx | 12 ++++++++++-- .../renderer/src/components/sidebar-content.tsx | 17 ++++++----------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/apps/x/apps/renderer/src/App.tsx b/apps/x/apps/renderer/src/App.tsx index 01ad2b52..446f7cd9 100644 --- a/apps/x/apps/renderer/src/App.tsx +++ b/apps/x/apps/renderer/src/App.tsx @@ -568,8 +568,8 @@ function App() { const voiceRef = useRef(voice) voiceRef.current = voice - // Check if voice is available on mount - useEffect(() => { + // Check if voice is available on mount and when OAuth state changes + const refreshVoiceAvailability = useCallback(() => { Promise.all([ window.ipc.invoke('voice:getConfig', null), window.ipc.invoke('oauth:getState', null), @@ -583,6 +583,14 @@ function App() { }) }, []) + useEffect(() => { + refreshVoiceAvailability() + const cleanup = window.ipc.on('oauth:didConnect', () => { + refreshVoiceAvailability() + }) + return cleanup + }, [refreshVoiceAvailability]) + const handleStartRecording = useCallback(() => { setIsRecording(true) isRecordingRef.current = true diff --git a/apps/x/apps/renderer/src/components/sidebar-content.tsx b/apps/x/apps/renderer/src/components/sidebar-content.tsx index db18a8df..cd85449b 100644 --- a/apps/x/apps/renderer/src/components/sidebar-content.tsx +++ b/apps/x/apps/renderer/src/components/sidebar-content.tsx @@ -488,19 +488,14 @@ export function SidebarContentPanel({ /> )} - {/* Billing status */} + {/* Billing / upgrade CTA */} {isRowboatConnected && billing && (
-
-
- - {billing.subscriptionPlan ?? 'Free'} - - - 8 days left - -
-