From b58cf4a8bfe8846aa72afb4d9cb309356d3b5d21 Mon Sep 17 00:00:00 2001 From: Ana Maksimovskikh Date: Mon, 11 Mar 2024 10:48:06 +0000 Subject: [PATCH] Fix duplicating key error for dApps with the same name --- src/utils/beacon/BeaconPeers.test.tsx | 25 +++++++++++++++++++++++++ src/utils/beacon/BeaconPeers.tsx | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/utils/beacon/BeaconPeers.test.tsx b/src/utils/beacon/BeaconPeers.test.tsx index e27a294e5e..57164c1125 100644 --- a/src/utils/beacon/BeaconPeers.test.tsx +++ b/src/utils/beacon/BeaconPeers.test.tsx @@ -88,6 +88,31 @@ describe("", () => { } }); + it("resolves duplicating name for diffferent dAppIds", async () => { + jest.spyOn(beaconHelper, "usePeers").mockReturnValue({ + data: [ + { + name: "dApp", + publicKey: "e15835f5b7bb7fae5a3ddbe3c71b3cdd9ee0a5ea2586f04e7669e9040f61810c", + senderId: "2MqUhvyAJy3UY", + type: "p2p-pairing-request", + id: "test-id-1", + version: "v1", + }, + { + name: "dApp", + publicKey: "e15835f5b7bb7fae5a3ddbe3c71b3cdd9ee0a5ea2586f04e7669e9040f61810b", + senderId: "2UJwaEUy23W3g", + type: "p2p-pairing-request", + id: "test-id-2", + version: "v1.5", + }, + ], + } as any); + + await getPeerRows(2); + }); + describe("for saved connections", () => { it("displays address pill with acc label if connected acc is present", async () => { store.dispatch( diff --git a/src/utils/beacon/BeaconPeers.tsx b/src/utils/beacon/BeaconPeers.tsx index 485039ac59..8258ac7413 100644 --- a/src/utils/beacon/BeaconPeers.tsx +++ b/src/utils/beacon/BeaconPeers.tsx @@ -52,7 +52,7 @@ export const BeaconPeers = () => { return ( {peersWithId.map(peerInfo => ( - + ))} );