|
|
|
@ -12,7 +12,6 @@
|
|
|
|
|
initialize() {
|
|
|
|
|
this.pubKeyRequests = [];
|
|
|
|
|
this.pubKey = null;
|
|
|
|
|
this.secretWords = null;
|
|
|
|
|
this.accepted = false;
|
|
|
|
|
this.view = '';
|
|
|
|
|
this.render();
|
|
|
|
@ -65,10 +64,6 @@
|
|
|
|
|
nextPubKey() {
|
|
|
|
|
// FIFO: pop at the back of the array using pop()
|
|
|
|
|
this.pubKey = this.pubKeyRequests.pop();
|
|
|
|
|
this.secretWords = window.mnemonic.mn_encode(this.pubKey.slice(2), 'english')
|
|
|
|
|
.split(' ')
|
|
|
|
|
.slice(-3)
|
|
|
|
|
.join(' ');
|
|
|
|
|
},
|
|
|
|
|
showView() {
|
|
|
|
|
const waitingForRequestView = this.$('.waitingForRequestView');
|
|
|
|
@ -79,7 +74,12 @@
|
|
|
|
|
waitingForRequestView.hide();
|
|
|
|
|
requestAcceptedView.show();
|
|
|
|
|
} else if (this.pubKey) {
|
|
|
|
|
this.$('.secretWords').text(this.secretWords);
|
|
|
|
|
const secretWords = window.mnemonic
|
|
|
|
|
.mn_encode(this.pubKey.slice(2), 'english')
|
|
|
|
|
.split(' ')
|
|
|
|
|
.slice(-3)
|
|
|
|
|
.join(' ');
|
|
|
|
|
this.$('.secretWords').text(secretWords);
|
|
|
|
|
requestReceivedView.show();
|
|
|
|
|
waitingForRequestView.hide();
|
|
|
|
|
requestAcceptedView.hide();
|
|
|
|
|