Deliver responses to multiple inpage providers on switch account action

This commit is contained in:
Ivan Grachev 2022-08-19 16:20:27 +03:00
parent e4ad237053
commit dca0e5bc48
2 changed files with 7 additions and 2 deletions

File diff suppressed because one or more lines are too long

View File

@ -71,7 +71,12 @@ function deliverResponseToSpecificProvider(id, response, provider) {
window.near.processTokenaryResponse(id, response);
break;
case "multiple":
// TODO: go through all bodies, enrich em with name and id, pass to each envolved provider
response.bodies.forEach((body) => {
body.id = id;
body.name = response.name;
deliverResponseToSpecificProvider(id, body, body.provider);
});
// TODO: disconnect response.providersToDisconnect
break;
default:
// pass unknown provider message to all providers