Renter settings
This commit is contained in:
@@ -85,7 +85,8 @@
|
||||
if (document.getElementById('ID_MountButton').innerText !== 'Unmount') {
|
||||
setSelect('ID_MountDrives', drives);
|
||||
}
|
||||
}
|
||||
},
|
||||
notifyDriveUnmounted: _notifyDriveUnmounted
|
||||
};
|
||||
})();
|
||||
|
||||
@@ -158,6 +159,8 @@
|
||||
};
|
||||
})();
|
||||
|
||||
let _mountHandler;
|
||||
|
||||
function setMainWindow(name) {
|
||||
console.log('Setting main window: ' + name);
|
||||
const elem = document.getElementById(name);
|
||||
@@ -181,13 +184,29 @@
|
||||
}
|
||||
}
|
||||
|
||||
function _notifyDriveUnmounted() {
|
||||
const mountButton = document.getElementById('ID_MountButton');
|
||||
const mountSelect = document.getElementById('ID_MountDrives');
|
||||
if (mountButton.innerText === 'Unmount') {
|
||||
mountButton.innerText = "Mount";
|
||||
mountButton.onclick = _mountHandler;
|
||||
mountButton.disabled = false;
|
||||
mountSelect.disabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
function beginMainApplication() {
|
||||
AppActions.startApp();
|
||||
setMainWindow('app_window');
|
||||
const renterEditLink = document.getElementById('ID_Renter_Edit');
|
||||
renterEditLink.onclick = ()=> {
|
||||
renterEditLink.onclick = null;
|
||||
handleRenterEditSettings();
|
||||
};
|
||||
const mountButton = document.getElementById('ID_MountButton');
|
||||
const mountSelect = document.getElementById('ID_MountDrives');
|
||||
|
||||
const mountHandler = ()=> {
|
||||
_mountHandler = ()=> {
|
||||
mountButton.onclick = null;
|
||||
mountButton.disabled = true;
|
||||
mountSelect.disabled = true;
|
||||
@@ -198,23 +217,31 @@
|
||||
} else {
|
||||
displayErrorPopup('Mount Failed', reason);
|
||||
}
|
||||
mountButton.onclick = mountHandler;
|
||||
mountButton.onclick = _mountHandler;
|
||||
mountButton.disabled = false;
|
||||
});
|
||||
} else {
|
||||
AppActions.unmountDrive((success, reason) => {
|
||||
if (success) {
|
||||
mountButton.innerText = "Mount";
|
||||
mountSelect.disabled = false;
|
||||
_notifyDriveUnmounted()
|
||||
} else {
|
||||
displayErrorPopup('Unmount Failed', reason);
|
||||
mountButton.onclick = _mountHandler;
|
||||
mountButton.disabled = false;
|
||||
}
|
||||
mountButton.onclick = mountHandler;
|
||||
mountButton.disabled = false;
|
||||
});
|
||||
}
|
||||
};
|
||||
mountButton.onclick = mountHandler;
|
||||
mountButton.onclick = _mountHandler;
|
||||
}
|
||||
|
||||
function handleRenterEditSettings() {
|
||||
setMainWindow('renter_settings_window');
|
||||
const cancelButton = document.getElementById('ID_RenterSettingsCancel');
|
||||
cancelButton.onclick = ()=> {
|
||||
cancelButton.onclick = null;
|
||||
beginMainApplication();
|
||||
}
|
||||
}
|
||||
|
||||
function handleUnlockWallet() {
|
||||
@@ -225,7 +252,6 @@
|
||||
unlockButton.onclick = null;
|
||||
const password = document.getElementById('ID_WalletUnlockPwd');
|
||||
if (AppActions.unlockWallet(password.value, (success, reason) => {
|
||||
password.value = '';
|
||||
if (success) {
|
||||
beginMainApplication();
|
||||
} else {
|
||||
@@ -234,7 +260,10 @@
|
||||
});
|
||||
}
|
||||
})) {
|
||||
password.value = '';
|
||||
setMainWindow('unlocking_window');
|
||||
} else {
|
||||
password.value = '';
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user