Skip to content

Commit abb9a5c

Browse files
author
Aasim Khan
committed
copilot comments
1 parent f3f4ef6 commit abb9a5c

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

extensions/mssql/src/models/connectionStore.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -694,9 +694,8 @@ export class ConnectionStore {
694694
let dupeCount = 0;
695695

696696
for (const conn of connResults) {
697-
const key = conn.id + "-" + conn.profileSource; // Use both ID and source as key to allow same profile in both lists
698-
const storedConn = uniqueConnections.get(key);
699-
if (storedConn === undefined || storedConn?.profileSource !== conn.profileSource) {
697+
const key = `${conn.id}-${conn.profileSource}`; // Use both ID and source as key to allow same profile in both lists
698+
if (!uniqueConnections.has(key)) {
700699
uniqueConnections.set(key, conn);
701700
} else {
702701
dupeCount++;

extensions/mssql/src/reactviews/pages/ConnectionDialog/connectionsListContainer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ export const ConnectionsListContainer = () => {
159159
return (
160160
<ConnectionCard
161161
connection={connection}
162-
key={"mru" + index}
162+
key={"mru" + connection.id}
163163
actionButton={{
164164
icon: <Delete16Regular />,
165165
onClick: (e) => {
@@ -188,7 +188,7 @@ export const ConnectionsListContainer = () => {
188188
return (
189189
<ConnectionCard
190190
connection={connection}
191-
key={"saved" + index}
191+
key={"saved" + connection.id}
192192
actionButton={{
193193
icon: <Delete16Regular />,
194194
onClick: (e) => {

0 commit comments

Comments
 (0)