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 ?? "";