|
|
@ -1,11 +1,7 @@
|
|
|
|
import { Component, OnInit, OnDestroy } from '@angular/core';
|
|
|
|
import { Component, OnInit, OnDestroy } from '@angular/core';
|
|
|
|
import { Router } from '@angular/router';
|
|
|
|
|
|
|
|
import { Subject } from 'rxjs';
|
|
|
|
import { Subject } from 'rxjs';
|
|
|
|
import { takeUntil } from 'rxjs/operators';
|
|
|
|
|
|
|
|
import { Store } from '@ngrx/store';
|
|
|
|
import { Store } from '@ngrx/store';
|
|
|
|
|
|
|
|
|
|
|
|
import { LoggerService } from '../../shared/services/logger.service';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import * as RTLActions from '../../shared/store/rtl.actions';
|
|
|
|
import * as RTLActions from '../../shared/store/rtl.actions';
|
|
|
|
import * as fromRTLReducer from '../../shared/store/rtl.reducers';
|
|
|
|
import * as fromRTLReducer from '../../shared/store/rtl.reducers';
|
|
|
|
|
|
|
|
|
|
|
@ -15,7 +11,13 @@ import * as fromRTLReducer from '../../shared/store/rtl.reducers';
|
|
|
|
styleUrls: ['./unlock-lnd.component.scss']
|
|
|
|
styleUrls: ['./unlock-lnd.component.scss']
|
|
|
|
})
|
|
|
|
})
|
|
|
|
export class UnlockLNDComponent implements OnInit, OnDestroy {
|
|
|
|
export class UnlockLNDComponent implements OnInit, OnDestroy {
|
|
|
|
|
|
|
|
walletOperation = 'init';
|
|
|
|
walletPassword = '';
|
|
|
|
walletPassword = '';
|
|
|
|
|
|
|
|
initWalletPassword = '';
|
|
|
|
|
|
|
|
existingCypher = false;
|
|
|
|
|
|
|
|
cypherSeed = '';
|
|
|
|
|
|
|
|
enterPassphrase = false;
|
|
|
|
|
|
|
|
passphrase = '';
|
|
|
|
private unsub = new Subject();
|
|
|
|
private unsub = new Subject();
|
|
|
|
|
|
|
|
|
|
|
|
constructor(private store: Store<fromRTLReducer.State>) {}
|
|
|
|
constructor(private store: Store<fromRTLReducer.State>) {}
|
|
|
@ -24,13 +26,32 @@ export class UnlockLNDComponent implements OnInit, OnDestroy {
|
|
|
|
this.walletPassword = '';
|
|
|
|
this.walletPassword = '';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
onOperateWallet(operation: string) {
|
|
|
|
onOperateWallet() {
|
|
|
|
this.store.dispatch(new RTLActions.OpenSpinner('Unlocking...'));
|
|
|
|
this.store.dispatch(new RTLActions.OpenSpinner('Unlocking...'));
|
|
|
|
this.store.dispatch(new RTLActions.OperateWallet({operation: operation, pwd: this.walletPassword}));
|
|
|
|
this.store.dispatch(new RTLActions.OperateWallet({operation: 'unlock', pwd: this.walletPassword}));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onInitWallet() {
|
|
|
|
|
|
|
|
this.store.dispatch(new RTLActions.OpenSpinner('Initializing...'));
|
|
|
|
|
|
|
|
// this.store.dispatch(new RTLActions.OperateWallet({operation: 'init', pwd: this.initWalletPassword}));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onExistingCypherChange(event: any) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onEnterPassphraseChange(event: any) {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
resetData() {
|
|
|
|
resetData() {
|
|
|
|
|
|
|
|
this.walletOperation = 'init';
|
|
|
|
this.walletPassword = '';
|
|
|
|
this.walletPassword = '';
|
|
|
|
|
|
|
|
this.initWalletPassword = '';
|
|
|
|
|
|
|
|
this.existingCypher = false;
|
|
|
|
|
|
|
|
this.cypherSeed = '';
|
|
|
|
|
|
|
|
this.enterPassphrase = false;
|
|
|
|
|
|
|
|
this.passphrase = '';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ngOnDestroy() {
|
|
|
|
ngOnDestroy() {
|
|
|
|