1
0

UI changes

This commit is contained in:
Scott E. Graves
2017-03-20 00:28:59 -05:00
parent a324e546a2
commit 6940b35939
5 changed files with 59 additions and 9 deletions

View File

@@ -23,11 +23,18 @@
const UiActions = (() => {
function _unlockWallet(pwd, cb) {
console.log('Unlock wallet');
return window.uiActions.unlockWallet(pwd, cb);
}
function _createWallet(cb) {
console.log('Create wallet');
return window.uiActions.createWallet(cb);
}
return {
unlockWallet: _unlockWallet
unlockWallet: _unlockWallet,
createWallet: _createWallet
};
})();
@@ -67,8 +74,7 @@
if (success) {
setMainWindow('app_window');
} else {
location.reload();
displayErrorPopup('Failed to unlock wallet', reason, ()=> {
displayErrorPopup('Error', reason, ()=> {
location.reload();
});
}
@@ -81,6 +87,18 @@
}
} else {
setMainWindow('create_window');
const createButton = document.getElementById('ID_CreateWalletButton');
createButton.onclick = () => {
UiActions.createWallet((success, reasonOrSeed) => {
if (success) {
setMainWindow('display_seed_window');
} else {
displayErrorPopup('Error', reasonOrSeed, ()=> {
location.reload();
});
}
});
};
}
} else {
setMainWindow('offline_window');