Skip to content

Commit 6289373

Browse files
committed
chore(example): update add apps to whiltelist
1 parent f01af8f commit 6289373

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

example/src/App.tsx

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -184,16 +184,18 @@ const App = () => {
184184
'com.talsecreactnativesecuritypluginexample',
185185
'com.example.myApp',
186186
];
187-
appsToWhitelist.forEach(async (app) => {
188-
try {
189-
const whitelistResponse = await addToWhitelist(app);
190-
console.info(
191-
`Malware Whitelist response for ${app}: ${whitelistResponse}`
192-
);
193-
} catch (error: any) {
194-
console.info('Error while adding app to malware whitelist: ', error);
195-
}
196-
});
187+
await Promise.all(
188+
appsToWhitelist.map(async (app) => {
189+
try {
190+
const whitelistResponse = await addToWhitelist(app);
191+
console.info(
192+
`${app} stored to Malware Whitelist: ${whitelistResponse}`
193+
);
194+
} catch (error) {
195+
console.info('Malware whitelist failed: ', error);
196+
}
197+
})
198+
);
197199
};
198200

199201
useFreeRasp(config, actions);

0 commit comments

Comments
 (0)