Single mount detection

This commit is contained in:
2019-11-11 13:15:57 -06:00
parent 1f42d5cff4
commit c33f142f27
5 changed files with 129 additions and 69 deletions

View File

@@ -86,7 +86,9 @@ const addListeners = (ipcMain, setTrayImage, standardIPCReply) => {
event.returnValue = response;
});
ipcMain.on(Constants.IPC_Detect_Mounts, (event, data) => {
ipcMain.on(Constants.IPC_Detect_Mount, (event, data) => {
const provider = data.Provider;
let driveLetters = {};
const providerList = [
...Constants.PROVIDER_LIST,
@@ -174,9 +176,10 @@ const addListeners = (ipcMain, setTrayImage, standardIPCReply) => {
if (firstMountCheck) {
firstMountCheck = false;
}
standardIPCReply(event, Constants.IPC_Detect_Mounts_Reply, {
DriveLetters: driveLetters,
Locations: locations,
standardIPCReply(event, Constants.IPC_Detect_Mount_Reply, {
DriveLetters: driveLetters[provider],
Location: locations[provider],
Provider: provider,
});
})
.catch(error => {
@@ -184,8 +187,9 @@ const addListeners = (ipcMain, setTrayImage, standardIPCReply) => {
grabDriveLetters({});
}
setImage({});
standardIPCReply(event, Constants.IPC_Detect_Mounts_Reply, {
DriveLetters: driveLetters,
standardIPCReply(event, Constants.IPC_Detect_Mount_Reply, {
DriveLetters: driveLetters[provider],
Provider: provider,
}, error);
});
});