From a2492ce09946bd63872fe5f2fe4e49a8f09aca08 Mon Sep 17 00:00:00 2001 From: Juan Manuel <44899916+angarita-dev@users.noreply.github.com> Date: Mon, 22 Aug 2022 10:24:49 -0500 Subject: [PATCH 1/2] Moved whitelist population to requestConnect --- source/Modules/Controller/connection.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source/Modules/Controller/connection.js b/source/Modules/Controller/connection.js index 00860f7d..88366f89 100644 --- a/source/Modules/Controller/connection.js +++ b/source/Modules/Controller/connection.js @@ -131,6 +131,11 @@ export class ConnectionModule extends ControllerModuleBase { const date = new Date().toISOString(); + const populatedWhitelist = canistersInfo.reduce( + (accum, canisterInfo) => ({ ...accum, [canisterInfo.id]: canisterInfo }), + {}, + ); + getApps(this.keyring?.currentWalletId.toString(), (apps = {}) => { const newApps = { ...apps, @@ -144,7 +149,7 @@ export class ConnectionModule extends ControllerModuleBase { events: [ ...apps[domainUrl]?.events || [], ], - whitelist, + whitelist: populatedWhitelist, host, }, }; @@ -209,7 +214,7 @@ export class ConnectionModule extends ControllerModuleBase { ? CONNECTION_STATUS.accepted : response.status; const whitelist = response.status === CONNECTION_STATUS.accepted - ? response.whitelist + ? apps[url]?.whitelist : []; const date = new Date().toISOString(); From 86f4f653475630df6e96d466aea84ee5880e2f51 Mon Sep 17 00:00:00 2001 From: Juan Manuel <44899916+angarita-dev@users.noreply.github.com> Date: Mon, 22 Aug 2022 10:25:05 -0500 Subject: [PATCH 2/2] Removed whitelist population --- source/views/Popup/components/AllowAgent/index.jsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/source/views/Popup/components/AllowAgent/index.jsx b/source/views/Popup/components/AllowAgent/index.jsx index fa2e64e3..708e1483 100644 --- a/source/views/Popup/components/AllowAgent/index.jsx +++ b/source/views/Popup/components/AllowAgent/index.jsx @@ -58,14 +58,10 @@ const AllowAgent = ({ const [expand, setExpand] = useState(false); const handleAllowAgent = async (status) => { - const whitelist = canisters.reduce( - (accum, canisterInfo) => ({ ...accum, [canisterInfo.id]: canisterInfo }), - {}, - ); reviewPendingTransaction(transactionId, () => {}); const success = await portRPC.call('handleAllowAgent', [ url, - { status, whitelist }, + { status }, callId, portId, transactionId,