diff --git a/main.qml b/main.qml index 0f937859..5f7035f7 100644 --- a/main.qml +++ b/main.qml @@ -245,12 +245,11 @@ ApplicationWindow { var dTargetBlock = currentWallet.daemonBlockChainTargetHeight(); leftPanel.daemonProgress.updateProgress(dCurrentBlock,dTargetBlock); - // Store wallet after first refresh. To prevent broken wallet after a crash - if(isNewWallet && currentWallet.blockChainHeight() > 0){ - currentWallet.store(persistentSettings.wallet_path) - isNewWallet = false - console.log("wallet stored after first successfull refresh") - } + // Store wallet after every refresh. + //TODO: Doesn't need path after creation. Change libwalletqt + currentWallet.store("") + console.log("Saving wallet"); + isNewWallet = false // initialize transaction history once wallet is initializef first time; if (!walletInitialized) { diff --git a/wizard/WizardMain.qml b/wizard/WizardMain.qml index 43200304..543ee14d 100644 --- a/wizard/WizardMain.qml +++ b/wizard/WizardMain.qml @@ -111,10 +111,16 @@ Rectangle { console.log("Here we apply the settings"); // here we need to actually move wallet to the new location + // Remove trailing slash - (default on windows and mac) + if (settings.wallet_path.substring(settings.wallet_path.length -1) === "/"){ + settings.wallet_path = settings.wallet_path.substring(0,settings.wallet_path.length -1) + } + var new_wallet_filename = settings.wallet_path + "/" + settings.account_name + "/" + settings.account_name; + console.log("saving to wizard: "+ new_wallet_filename) // moving wallet files to the new destination, if user changed it if (new_wallet_filename !== settings.wallet_filename) { // using previously saved wallet;