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

@@ -150,7 +150,7 @@ const LoginView: Component<LoginViewProps> = (props) => {
<button
type="submit"
disabled={isLoggingIn() || !selectedUserId()}
disabled={isLoggingIn() || !username()}
class="w-full flex items-center justify-center gap-3 py-4 bg-gradient-to-r from-blue-600 via-indigo-600 to-purple-600 hover:from-blue-500 hover:to-purple-500 text-white font-bold rounded-2xl shadow-xl shadow-blue-900/20 transform active:scale-[0.98] transition-all disabled:opacity-50 disabled:cursor-not-allowed group"
>
<Show when={isLoggingIn()} fallback={

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}`)