Added remove remote mount
This commit is contained in:
@@ -2,6 +2,7 @@ const Constants = require('../../constants');
|
||||
const fs = require('fs');
|
||||
const helpers = require('../../helpers');
|
||||
const os = require('os');
|
||||
const path = require('path');
|
||||
|
||||
let expectedUnmount = {};
|
||||
let firstMountCheck = true;
|
||||
@@ -230,6 +231,18 @@ const addListeners = (ipcMain, setTrayImage, standardIPCReply) => {
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.on(Constants.IPC_Remove_Remote_Mount, (event, data) => {
|
||||
data = data.replace(':', '_');
|
||||
const dataDirectory = path.resolve(path.join(helpers.getDataDirectory(), '..', 'remote', data));
|
||||
|
||||
try {
|
||||
helpers.removeDirectoryRecursively(dataDirectory);
|
||||
standardIPCReply(event, Constants.IPC_Remove_Remote_Mount_Reply, {DataDirectory: dataDirectory});
|
||||
} catch (e) {
|
||||
standardIPCReply(event, Constants.IPC_Remove_Remote_Mount_Reply, {DataDirectory: dataDirectory}, e);
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.on(Constants.IPC_Unmount_All_Drives, (event, data) => {
|
||||
unmountAllDrives();
|
||||
standardIPCReply(event, Constants.IPC_Unmount_All_Drives_Reply);
|
||||
|
||||
Reference in New Issue
Block a user