Fix key count

This commit is contained in:
Scott E. Graves
2018-12-11 22:17:34 -06:00
parent 0a14ca1873
commit eb5198d601

View File

@@ -280,7 +280,7 @@ ipcMain.on(Constants.IPC_Detect_Mounts, (event, data) => {
for (let i = 'c'.charCodeAt(0); i <= 'z'.charCodeAt(0); i++) { for (let i = 'c'.charCodeAt(0); i <= 'z'.charCodeAt(0); i++) {
const drive = (String.fromCharCode(i) + ':').toUpperCase(); const drive = (String.fromCharCode(i) + ':').toUpperCase();
let driveInUse; let driveInUse;
if (locations.length > 0) { if (Object.keys(locations).length > 0) {
for (const provider of Constants.PROVIDER_LIST) { for (const provider of Constants.PROVIDER_LIST) {
driveInUse = locations[provider].startsWith(drive); driveInUse = locations[provider].startsWith(drive);
if (driveInUse) if (driveInUse)
@@ -299,7 +299,7 @@ ipcMain.on(Constants.IPC_Detect_Mounts, (event, data) => {
} }
} }
if (locations.length > 0) { if (Object.keys(locations).length > 0) {
for (const provider of Constants.PROVIDER_LIST) { for (const provider of Constants.PROVIDER_LIST) {
if (locations[provider].length > 0) { if (locations[provider].length > 0) {
if (!driveLetters[provider].find((driveLetter) => { if (!driveLetters[provider].find((driveLetter) => {
@@ -315,7 +315,7 @@ ipcMain.on(Constants.IPC_Detect_Mounts, (event, data) => {
const setImage = (locations) => { const setImage = (locations) => {
if (os.platform() === 'win32' || os.platform() === 'linux') { if (os.platform() === 'win32' || os.platform() === 'linux') {
let driveInUse; let driveInUse;
if (locations.length > 0) { if (Object.keys(locations).length > 0) {
for (const provider of Constants.PROVIDER_LIST) { for (const provider of Constants.PROVIDER_LIST) {
driveInUse = locations[provider].length > 0; driveInUse = locations[provider].length > 0;
if (driveInUse) if (driveInUse)