Changes
This commit is contained in:
@@ -174,26 +174,32 @@
|
||||
AppActions.startApp();
|
||||
setMainWindow('app_window');
|
||||
const mountButton = document.getElementById('ID_MountButton');
|
||||
|
||||
const mountSelect = document.getElementById('ID_MountDrives');
|
||||
|
||||
const mountHandler = ()=> {
|
||||
mountButton.onclick = null;
|
||||
mountButton.disabled = true;
|
||||
mountSelect.disabled = true;
|
||||
if (mountButton.innerText === "Mount") {
|
||||
AppActions.mountDrive(document.getElementById('ID_MountDrives').value, (success, reason) => {
|
||||
AppActions.mountDrive(mountSelect.value, (success, reason) => {
|
||||
if (success) {
|
||||
mountButton.innerText = "Unmount";
|
||||
} else {
|
||||
displayErrorPopup('Mount Failed', reason);
|
||||
}
|
||||
mountButton.onclick = mountHandler;
|
||||
mountButton.disabled = false;
|
||||
});
|
||||
} else {
|
||||
AppActions.unmountDrive((success, reason) => {
|
||||
if (success) {
|
||||
mountButton.innerText = "Mount";
|
||||
mountSelect.disabled = false;
|
||||
} else {
|
||||
displayErrorPopup('Unmount Failed', reason);
|
||||
}
|
||||
mountButton.onclick = mountHandler;
|
||||
mountButton.disabled = false;
|
||||
});
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user