Prompt for unlock on store password
This commit is contained in:
@@ -395,7 +395,7 @@
|
||||
'RpcPort': getValue('ID_Settings_RpcPort')
|
||||
}, (success, reason) => {
|
||||
if (success) {
|
||||
beginMainApplication(false);
|
||||
reloadApplication(false);
|
||||
} else {
|
||||
displayErrorPopup('Settings Failed', reason);
|
||||
handleSiaEditSettings();
|
||||
@@ -635,7 +635,6 @@
|
||||
|
||||
function reloadApplication(checkAutoMount) {
|
||||
document.getElementById('ID_SiaDrive').innerText = 'SiaDrive ' + UiState.clientVersion();
|
||||
document.getElementById('ID_ServerVersion').innerText = '...';
|
||||
if (UiState.isOnline()) {
|
||||
if (UiState.isWalletConfigured()) {
|
||||
if (UiState.isWalletLocked()) {
|
||||
@@ -653,6 +652,7 @@
|
||||
|
||||
window.addEventListener('load', ()=> {
|
||||
console.log('Main window load');
|
||||
document.getElementById('ID_ServerVersion').innerText = '...';
|
||||
reloadApplication(true);
|
||||
});
|
||||
})();
|
@@ -31,7 +31,7 @@ pushd 3rd_party
|
||||
)
|
||||
popd
|
||||
|
||||
"%INNO_COMPILER%" /cc SiaDrive_Packager_%MODE%.iss
|
||||
"%INNO_COMPILER%" /cc SiaDrive_Packager_%MODE%.iss || goto :ERROR
|
||||
|
||||
goto :END
|
||||
|
||||
|
@@ -1,5 +1,4 @@
|
||||
@echo off
|
||||
pushd "%~dp0%"
|
||||
call package.cmd Debug
|
||||
pause
|
||||
popd
|
@@ -1,5 +1,4 @@
|
||||
@echo off
|
||||
pushd "%~dp0%"
|
||||
call package.cmd Release
|
||||
pause
|
||||
popd
|
@@ -284,8 +284,12 @@ public:
|
||||
}
|
||||
else if (name == "setSiaSettings")
|
||||
{
|
||||
auto global = context->GetGlobal();
|
||||
auto uiState = global->GetValue("uiState");
|
||||
|
||||
CefRefPtr<CefV8Value> settings = arguments[0];
|
||||
CefRefPtr<CefV8Value> cb = arguments[1];
|
||||
const bool storePwd = _siaDriveConfig->GetStoreUnlockPassword();
|
||||
_siaDriveConfig->SetLaunchFileMgrOnMount(settings->GetValue("LaunchFileMgrOnMount")->GetBoolValue());
|
||||
_siaDriveConfig->SetAutoStartOnLogon(settings->GetValue("AutoStartOnLogon")->GetBoolValue());
|
||||
_siaDriveConfig->SetLaunchBundledSiad(settings->GetValue("LaunchBundledSiad")->GetBoolValue());
|
||||
@@ -297,12 +301,21 @@ public:
|
||||
_siaDriveConfig->SetStoreUnlockPassword(settings->GetValue("StoreUnlockPassword")->GetBoolValue());
|
||||
_siaDriveConfig->SetAutoMountOnUnlock(settings->GetValue("AutoMountOnUnlock")->GetBoolValue());
|
||||
_siaDriveConfig->SetConfirmApplicationExit(settings->GetValue("ConfirmApplicationExit")->GetBoolValue());
|
||||
if (!_siaDriveConfig->GetStoreUnlockPassword())
|
||||
if (!storePwd && _siaDriveConfig->GetStoreUnlockPassword())
|
||||
{
|
||||
// Lock to prompt for password
|
||||
_siaApi.GetWallet()->Lock();
|
||||
while (_appStarted && !_siaApi.GetWallet()->GetLocked())
|
||||
{
|
||||
::Sleep(10);
|
||||
}
|
||||
uiState->SetValue("isWalletLocked", CefV8Value::CreateBool(true), V8_PROPERTY_ATTRIBUTE_NONE);
|
||||
}
|
||||
else if (!_siaDriveConfig->GetStoreUnlockPassword())
|
||||
{
|
||||
SetRegistry("Unlock", "");
|
||||
}
|
||||
|
||||
auto uiState = context->GetGlobal()->GetValue("uiState");
|
||||
uiState->SetValue("storeUnlockPassword", CefV8Value::CreateBool(_siaDriveConfig->GetStoreUnlockPassword()), V8_PROPERTY_ATTRIBUTE_READONLY);
|
||||
|
||||
CefRefPtr<CefProcessMessage> msg = CefProcessMessage::Create("settingsUpdated");
|
||||
|
Reference in New Issue
Block a user