From ee857474e36557df0696670ce5444ea79c83180e Mon Sep 17 00:00:00 2001 From: Vantz Stockwell Date: Wed, 18 Mar 2026 03:09:23 -0400 Subject: [PATCH] =?UTF-8?q?fix:=20TS=20type=20error=20=E2=80=94=20invoke?= =?UTF-8?q?=20returns=20array=20not=20single=20object?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.6 (1M context) --- src/stores/session.store.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/stores/session.store.ts b/src/stores/session.store.ts index 56ab124..83fb2d5 100644 --- a/src/stores/session.store.ts +++ b/src/stores/session.store.ts @@ -104,8 +104,8 @@ export const useSessionStore = defineStore("session", () => { // If connection has a linked credential, decrypt it from the vault if (conn.credentialId) { try { - const cred = await invoke<{ id: number; name: string; username: string | null; credentialType: string; sshKeyId: number | null }>("list_credentials") - .then((creds: any[]) => creds.find((c: any) => c.id === conn.credentialId)); + const allCreds = await invoke<{ id: number; name: string; username: string | null; credentialType: string; sshKeyId: number | null }[]>("list_credentials"); + const cred = allCreds.find((c) => c.id === conn.credentialId); if (cred) { resolvedUsername = cred.username ?? "";