Unlock
This commit is contained in:
@@ -183,7 +183,8 @@
|
||||
<input type="checkbox" id="ID_Settings_AutoStartOnLogon"> Auto-start on logon<br><br>
|
||||
<input type="checkbox" id="ID_Settings_LaunchFileMgrOnMount"> Launch file manager on mount<br><br>
|
||||
<input type="checkbox" id="ID_Settings_CloseToTray"> Close to system tray<br><br>
|
||||
<input type="checkbox" id="ID_Settings_LaunchBundledSiad"> Use Bundled siad<br><br>
|
||||
<input type="checkbox" id="ID_Settings_StoreUnlockPassword"> Store unlock password<br><br>
|
||||
<input type="checkbox" id="ID_Settings_LaunchBundledSiad"> Use bundled siad<br><br>
|
||||
<h1>API Port</h1>
|
||||
<input type="number" id="ID_Settings_ApiPort"><br><br>
|
||||
<h1>Host Port</h1>
|
||||
|
@@ -208,13 +208,18 @@
|
||||
return window.uiState.defaultRenterSettings;
|
||||
}
|
||||
|
||||
function _getStoreUnlockPassword() {
|
||||
return window.uiState.storeUnlockPassword;
|
||||
}
|
||||
|
||||
return {
|
||||
clientVersion: _clientVersion,
|
||||
isOnline: _isOnline,
|
||||
isWalletConfigured: _isWalletConfigured,
|
||||
isWalletLocked: _isWalletLocked,
|
||||
allocatedRenterFunds: _allocatedRenterFunds,
|
||||
defaultRenterSettings: _defaultRenterSettings
|
||||
defaultRenterSettings: _defaultRenterSettings,
|
||||
getStoreUnlockPassword: _getStoreUnlockPassword
|
||||
};
|
||||
})();
|
||||
|
||||
@@ -229,6 +234,10 @@
|
||||
return window.appActions.mountDrive(mountLocation, cb);
|
||||
}
|
||||
|
||||
function _autoUnlockWallet(cb) {
|
||||
return window.appActions.autoUnlockWallet(cb);
|
||||
}
|
||||
|
||||
function _unlockWallet(pwd, cb) {
|
||||
return window.appActions.unlockWallet(pwd, cb);
|
||||
}
|
||||
@@ -258,6 +267,7 @@
|
||||
createWallet: _createWallet,
|
||||
mountDrive: _mountDrive,
|
||||
unlockWallet: _unlockWallet,
|
||||
autoUnlockWallet: _autoUnlockWallet,
|
||||
unmountDrive: _unmountDrive,
|
||||
shutdown: _shutdown,
|
||||
setRenterSettings: _setRenterSettings,
|
||||
@@ -334,7 +344,8 @@
|
||||
'HostPort': getValue('ID_Settings_HostPort'),
|
||||
'RpcPort': getValue('ID_Settings_RpcPort'),
|
||||
'LaunchFileMgrOnMount': getChecked('ID_Settings_LaunchFileMgrOnMount'),
|
||||
'CloseToTray': getChecked('ID_Settings_CloseToTray')
|
||||
'CloseToTray': getChecked('ID_Settings_CloseToTray'),
|
||||
'StoreUnlockPassword': getChecked('ID_Settings_StoreUnlockPassword')
|
||||
}, (success, reason) => {
|
||||
if (success) {
|
||||
beginMainApplication();
|
||||
@@ -453,9 +464,8 @@
|
||||
};
|
||||
}
|
||||
|
||||
function handleUnlockWallet() {
|
||||
function manualUnlockWallet() {
|
||||
setMainWindow('unlock_window');
|
||||
|
||||
const unlockButton = document.getElementById('ID_UnlockWalletButton');
|
||||
unlockButton.onclick = () => {
|
||||
unlockButton.onclick = null;
|
||||
@@ -477,6 +487,24 @@
|
||||
};
|
||||
}
|
||||
|
||||
function handleUnlockWallet() {
|
||||
if (UiState.getStoreUnlockPassword()) {
|
||||
if (AppActions.autoUnlockWallet((success) => {
|
||||
if (success) {
|
||||
beginMainApplication();
|
||||
} else {
|
||||
manualUnlockWallet();
|
||||
}
|
||||
})) {
|
||||
setMainWindow('unlocking_window');
|
||||
} else {
|
||||
manualUnlockWallet();
|
||||
}
|
||||
} else {
|
||||
manualUnlockWallet();
|
||||
}
|
||||
}
|
||||
|
||||
function handleWalletCreated(seed) {
|
||||
setMainWindow('wallet_created_window');
|
||||
document.getElementById('ID_WalletSeed').innerText = seed;
|
||||
|
Reference in New Issue
Block a user