1
0
Fork 0
forked from lthn/blockchain

Enable auto-resume for staking

This commit is contained in:
wildkif 2019-05-29 18:16:37 +03:00
parent 6c0dcf2b22
commit 6249d80699
4 changed files with 16 additions and 3 deletions

View file

@ -1875,7 +1875,7 @@ var BackendService = /** @class */ (function () {
var _this = this;
var wallets = [];
this.variablesService.wallets.forEach(function (wallet) {
wallets.push({ name: wallet.name, pass: wallet.pass, path: wallet.path });
wallets.push({ name: wallet.name, pass: wallet.pass, path: wallet.path, staking: wallet.staking });
});
this.backendObject['store_secure_app_data'](JSON.stringify(wallets), this.variablesService.appPass, function (dataStore) {
_this.backendCallback(dataStore, {}, callback, 'store_secure_app_data');
@ -4417,6 +4417,13 @@ var LoginComponent = /** @class */ (function () {
_this.ngZone.run(function () {
var new_wallet = new _helpers_models_wallet_model__WEBPACK_IMPORTED_MODULE_6__["Wallet"](open_data.wallet_id, wallet.name, wallet.pass, open_data['wi'].path, open_data['wi'].address, open_data['wi'].balance, open_data['wi'].unlocked_balance, open_data['wi'].mined_total, open_data['wi'].tracking_hey);
new_wallet.alias = _this.backend.getWalletAlias(new_wallet.address);
if (wallet.staking) {
new_wallet.staking = true;
_this.backend.startPosMining(new_wallet.wallet_id);
}
else {
new_wallet.staking = false;
}
if (open_data.recent_history && open_data.recent_history.history) {
new_wallet.prepareHistory(open_data.recent_history.history);
}

File diff suppressed because one or more lines are too long

View file

@ -308,7 +308,7 @@ export class BackendService {
storeSecureAppData(callback?) {
const wallets = [];
this.variablesService.wallets.forEach((wallet) => {
wallets.push({name: wallet.name, pass: wallet.pass, path: wallet.path});
wallets.push({name: wallet.name, pass: wallet.pass, path: wallet.path, staking: wallet.staking});
});
this.backendObject['store_secure_app_data'](JSON.stringify(wallets), this.variablesService.appPass, (dataStore) => {
this.backendCallback(dataStore, {}, callback, 'store_secure_app_data');

View file

@ -104,6 +104,12 @@ export class LoginComponent implements OnInit, OnDestroy {
open_data['wi'].tracking_hey
);
new_wallet.alias = this.backend.getWalletAlias(new_wallet.address);
if (wallet.staking) {
new_wallet.staking = true;
this.backend.startPosMining(new_wallet.wallet_id);
} else {
new_wallet.staking = false;
}
if (open_data.recent_history && open_data.recent_history.history) {
new_wallet.prepareHistory(open_data.recent_history.history);
}