fix: resolve ReferenceError and strengthen IPC invocation in login flow
Some checks failed
Release Binaries / release (push) Has been cancelled

This commit is contained in:
Gemini AI
2025-12-29 02:33:50 +04:00
Unverified
parent 87b2595189
commit 0e540f2dd6
2 changed files with 6 additions and 2 deletions

View File

@@ -107,7 +107,11 @@ export async function initializeUserContext(): Promise<void> {
const api = (window as any).electronAPI || (window as any).electron
if (api) {
console.log(`[UserContext] Requesting active user from host IPC...`)
const activeUser = await (api.invoke ? api.invoke("users:active") : api.ipcRenderer.invoke("users:active"))
const invoke = api.invoke || api.ipcRenderer?.invoke || (window as any).ipcRenderer?.invoke
if (!invoke) throw new Error("No IPC invoke method found")
const binder = api.invoke ? api : (api.ipcRenderer || (window as any).ipcRenderer)
const activeUser = await invoke.call(binder, "users:active")
if (activeUser?.id) {
console.log(`[UserContext] Host has active session: ${activeUser.id}`)