Skip to content

Commit

Permalink
Merge pull request #565 from Psychedelic/fix/app-canister-list
Browse files Browse the repository at this point in the history
Fix/app canister list
  • Loading branch information
tomiir authored Aug 22, 2022
2 parents 53f2027 + 86f4f65 commit 74ebb99
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
9 changes: 7 additions & 2 deletions source/Modules/Controller/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -144,7 +149,7 @@ export class ConnectionModule extends ControllerModuleBase {
events: [
...apps[domainUrl]?.events || [],
],
whitelist,
whitelist: populatedWhitelist,
host,
},
};
Expand Down Expand Up @@ -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();
Expand Down
6 changes: 1 addition & 5 deletions source/views/Popup/components/AllowAgent/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 74ebb99

Please sign in to comment.