only show the picker if there is more than 1 cert (#1354)

This commit is contained in:
Guillermo Vayá
2020-07-30 10:50:25 +02:00
committed by GitHub
parent a47feb6b61
commit 96597332a0

View File

@@ -332,12 +332,16 @@ function handleAppBeforeQuit() {
}
function handleSelectCertificate(event, webContents, url, list, callback) {
event.preventDefault(); // prevent the app from getting the first certificate available
// store callback so it can be called with selected certificate
certificateRequests.set(url, callback);
if (list.length > 1) {
event.preventDefault(); // prevent the app from getting the first certificate available
// store callback so it can be called with selected certificate
certificateRequests.set(url, callback);
// open modal for selecting certificate
mainWindow.webContents.send('select-user-certificate', url, list);
// open modal for selecting certificate
mainWindow.webContents.send('select-user-certificate', url, list);
} else {
log.info(`There were ${list.length} candidate certificates. Skipping certificate selection`);
}
}
function handleSelectedCertificate(event, server, cert) {