diff --git a/electron.js b/electron.js index 432b357..5175b7c 100644 --- a/electron.js +++ b/electron.js @@ -37,7 +37,7 @@ function createWindow() { loadUiSettings(); // Create the browser window. - const height = (process.env.ELECTRON_START_URL ? 400 : 380) - (os.platform() === 'win32' ? 0 : 24); + const height = (process.env.ELECTRON_START_URL ? 364 : 344) - ((os.platform() === 'win32') || (os.platform() === 'darwin') ? 0 : 24); mainWindow = new BrowserWindow({ width: 428 + (os.platform() === 'win32' ? 0 : 120), height: height, @@ -181,6 +181,13 @@ if (!instanceLock) { }); } +const clearManualMountDetection = (storageType) => { + if (manualMountDetection[storageType]) { + clearInterval(manualMountDetection[storageType]); + delete manualMountDetection[storageType]; + } +}; + const loadUiSettings = () => { const settingFile = path.join(helpers.resolvePath(Constants.DATA_LOCATIONS[os.platform()]), 'ui.json'); try { @@ -199,9 +206,7 @@ const monitorMount = (sender, storageType, dataDirectory, version, pid, location .then(result => { if (result[storageType].PID !== pid) { if (result[storageType].PID === -1) { - clearTimeout(manualMountDetection[storageType]); - delete manualMountDetection[storageType]; - + clearManualMountDetection(storageType); sender.send(Constants.IPC_Unmount_Drive_Reply, { data: { Expected: expectedUnmount[storageType], @@ -674,10 +679,7 @@ ipcMain.on(Constants.IPC_Shutdown, () => { }); ipcMain.on(Constants.IPC_Unmount_Drive, (event, data) => { - if (manualMountDetection[data.StorageType]) { - clearInterval(manualMountDetection[data.StorageType]); - delete manualMountDetection[data.StorageType]; - } + clearManualMountDetection(data.StorageType); const dataDirectory = helpers.resolvePath(data.Directory); expectedUnmount[data.StorageType] = true; diff --git a/package.json b/package.json index 0f8b972..ee8436a 100644 --- a/package.json +++ b/package.json @@ -131,7 +131,7 @@ "linux": { "icon": "./build/icon.icns" }, - "mac": { + "mac": { "icon": "./build/icon.icns" }, "win": { diff --git a/src/App.js b/src/App.js index 1bd8781..816c872 100644 --- a/src/App.js +++ b/src/App.js @@ -684,7 +684,7 @@ class App extends Component { let key = 0; mainContent.push((