fix: resolve ReferenceError and strengthen IPC invocation in login flow
Some checks failed
Release Binaries / release (push) Has been cancelled
Some checks failed
Release Binaries / release (push) Has been cancelled
This commit is contained in:
@@ -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}`)
|
||||
|
||||
Reference in New Issue
Block a user