From 96597332a059c4e41e99c5032010679f204f4fc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillermo=20Vay=C3=A1?= Date: Thu, 30 Jul 2020 10:50:25 +0200 Subject: [PATCH] only show the picker if there is more than 1 cert (#1354) --- src/main.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main.js b/src/main.js index 1d58ab8d..e37c90f6 100644 --- a/src/main.js +++ b/src/main.js @@ -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) {