Layout changes

This commit is contained in:
Scott E. Graves
2018-12-13 13:30:40 -06:00
parent add2797fda
commit 98e06b4498
4 changed files with 61 additions and 33 deletions

View File

@@ -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;