You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
825 B
TypeScript
31 lines
825 B
TypeScript
import { Component, OnInit } from '@angular/core';
|
|
import { Store } from '@ngrx/store';
|
|
import * as RTLActions from '../../../store/rtl.actions';
|
|
import * as fromRTLReducer from '../../../store/rtl.reducers';
|
|
|
|
@Component({
|
|
selector: 'rtl-unlock-wallet',
|
|
templateUrl: './unlock.component.html',
|
|
styleUrls: ['./unlock.component.scss']
|
|
})
|
|
export class UnlockWalletComponent implements OnInit {
|
|
walletPassword = '';
|
|
|
|
constructor(private store: Store<fromRTLReducer.RTLState>) {}
|
|
|
|
ngOnInit() {
|
|
this.walletPassword = '';
|
|
}
|
|
|
|
onUnlockWallet() {
|
|
if(!this.walletPassword) { return true; }
|
|
this.store.dispatch(new RTLActions.OpenSpinner('Unlocking...'));
|
|
this.store.dispatch(new RTLActions.UnlockWallet({pwd: window.btoa(this.walletPassword)}));
|
|
}
|
|
|
|
resetData() {
|
|
this.walletPassword = '';
|
|
}
|
|
|
|
}
|