debug: add console.log to LocalKeyGate and settings event
Debugging button click issues 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.5
parent
e71e768828
commit
c562f69efa
@@ -47,7 +47,9 @@ export function LocalKeyGate({ children }: LocalKeyGateProps) {
|
||||
}
|
||||
|
||||
const openApiKeySettings = () => {
|
||||
console.log('[LocalKeyGate] openApiKeySettings clicked');
|
||||
if (typeof window !== 'undefined') {
|
||||
console.log('[LocalKeyGate] Dispatching settings:open event');
|
||||
window.dispatchEvent(new CustomEvent('settings:open', { detail: { tab: 'apikeys' } }));
|
||||
}
|
||||
};
|
||||
@@ -80,7 +82,10 @@ export function LocalKeyGate({ children }: LocalKeyGateProps) {
|
||||
</button>
|
||||
<button
|
||||
style={{ ...buttonStyle, background: '#1f2933', color: '#e5e7eb' }}
|
||||
onClick={() => setHasKeys(true)}
|
||||
onClick={() => {
|
||||
console.log('[LocalKeyGate] Dismiss clicked');
|
||||
setHasKeys(true);
|
||||
}}
|
||||
>
|
||||
Dismiss
|
||||
</button>
|
||||
|
||||
@@ -115,10 +115,12 @@ export default function ThreePanelLayout() {
|
||||
// Listen for settings:open events (from LocalKeyGate)
|
||||
useEffect(() => {
|
||||
const handleSettingsOpen = (e: CustomEvent<{ tab?: SettingsTab }>) => {
|
||||
console.log('[ThreePanelLayout] settings:open event received', e.detail);
|
||||
setSettingsInitialTab(e.detail?.tab || 'apikeys');
|
||||
setShowSettings(true);
|
||||
};
|
||||
window.addEventListener('settings:open', handleSettingsOpen as EventListener);
|
||||
console.log('[ThreePanelLayout] settings:open listener registered');
|
||||
return () => window.removeEventListener('settings:open', handleSettingsOpen as EventListener);
|
||||
}, []);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user