When passing an array of extensions, only the name of the final extension installed is returned
timsgardner opened this issue · comments
Tims Gardner commented
For example,
const installed = await installExtensions([REACT_DEVELOPER_TOOLS, REDUX_DEVTOOLS]);
console.log('installed:', installed);
will print
installed: Redux DevTools
whereas the jsdocs suggest it should return the names of all the extensions:
electron-devtools-installer/src/index.ts
Line 44 in 19fd4dd
It looks like this is because the reduce
in install
throws away previous string values:
electron-devtools-installer/src/index.ts
Line 64 in 19fd4dd
Dimitri Mitropoulos commented
as a workaround for anyone else encountering this, over on insomnia, we did:
if (isDevelopment()) {
try {
const extensions = [REACT_DEVELOPER_TOOLS, REDUX_DEVTOOLS];
const extensionsPlural = extensions.length > 0 ? 's' : '';
const names = await Promise.all(extensions.map(extension => installExtension(extension)));
console.log(`[electron-extensions] Added DevTools Extension${extensionsPlural}: ${names.join(', ')}`);
} catch (err) {
console.log('[electron-extensions] An error occurred: ', err);
}
}