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(); 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,