1
0

Mo stuffs

This commit is contained in:
Scott E. Graves
2017-03-22 13:24:53 -05:00
parent 9efbae3fb9
commit 2e3730b3d1
9 changed files with 151 additions and 72 deletions

View File

@@ -114,6 +114,11 @@
console.log('Create wallet');
return window.appActions.createWallet(cb);
}
function _mountDrive(mountLocation, cb) {
console.log('Mount drive: ' + mountLocation);
return window.appActions.mountDrive(mountLocation, cb);
}
function _startApp() {
window.appActions.startApp();
@@ -124,15 +129,21 @@
}
function _unlockWallet(pwd, cb) {
console.log('Unlock wallet');
return window.appActions.unlockWallet(pwd, cb);
}
function _unmountDrive(cb) {
console.log('Unmount drive');
return window.appActions.unmountDrive(cb);
}
return {
createWallet: _createWallet,
mountDrive: _mountDrive,
startApp: _startApp,
stopApp: _stopApp,
unlockWallet: _unlockWallet
unlockWallet: _unlockWallet,
unmountDrive: _unmountDrive
};
})();
@@ -162,6 +173,31 @@
function beginMainApplication() {
AppActions.startApp();
setMainWindow('app_window');
const mountButton = document.getElementById('ID_MountButton');
const mountHandler = ()=> {
mountButton.onclick = null;
if (mountButton.innerText === "Mount") {
AppActions.mountDrive(document.getElementById('ID_MountDrives').value, (success, reason) => {
if (success) {
mountButton.innerText = "Unmount";
} else {
displayErrorPopup('Mount Failed', reason);
}
mountButton.onclick = mountHandler;
});
} else {
AppActions.unmountDrive((success, reason) => {
if (success) {
mountButton.innerText = "Mount";
} else {
displayErrorPopup('Unmount Failed', reason);
}
mountButton.onclick = mountHandler;
});
}
};
mountButton.onclick = mountHandler;
}
function handleUnlockWallet() {