From 88686f6a9916d69918a463aacfbf95dc252e2ed7 Mon Sep 17 00:00:00 2001 From: Chase Fleming <1666730+chasefleming@users.noreply.github.com> Date: Tue, 23 Aug 2022 16:49:19 -0700 Subject: [PATCH] PKG -- [fcl] Respect service method for discovery Addresses: https://github.com/onflow/fcl-js/issues/1374 --- packages/fcl/src/discovery/utils.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/fcl/src/discovery/utils.js b/packages/fcl/src/discovery/utils.js index e00d31b36..0ec5528c6 100644 --- a/packages/fcl/src/discovery/utils.js +++ b/packages/fcl/src/discovery/utils.js @@ -7,19 +7,15 @@ export const makeDiscoveryServices = async () => { return [...extensionServices, ...serviceRegistry.getServices()] } -// Certain method types cannot be overridden to use other methods like POP/RCP -const isServiceMethodUnchangable = method => - ["EXT/RPC", "WC/RPC"].includes(method) - export async function getDiscoveryService(service) { const discoveryAuthnInclude = await config.get("discovery.authn.include", []) const discoveryWalletMethod = await config.first([ "discovery.wallet.method", "discovery.wallet.method.default", ]) - const method = isServiceMethodUnchangable(service?.method) + const method = service?.method ? service.method - : discoveryWalletMethod || service.method + : discoveryWalletMethod const endpoint = service?.endpoint ?? (await config.first(["discovery.wallet", "challenge.handshake"]))