Simplify and lint

pull/466/head
sachaaaaa 6 years ago
parent e50a29ffa5
commit ef6b22f6b9

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

@ -208,7 +208,8 @@
countDownCallBack(); countDownCallBack();
this.pairingInterval = setInterval(countDownCallBack, 1000); this.pairingInterval = setInterval(countDownCallBack, 1000);
const pubkey = textsecure.storage.user.getNumber(); const pubkey = textsecure.storage.user.getNumber();
const words = window.mnemonic.mn_encode(pubkey.slice(2), 'english') const words = window.mnemonic
.mn_encode(pubkey.slice(2), 'english')
.split(' ') .split(' ')
.slice(-3) .slice(-3)
.join(' '); .join(' ');

@ -110,7 +110,9 @@
'private' 'private'
); );
const lokiProfile = conversation.getLokiProfile(); const lokiProfile = conversation.getLokiProfile();
const profile = new textsecure.protobuf.DataMessage.LokiProfile(lokiProfile); const profile = new textsecure.protobuf.DataMessage.LokiProfile(
lokiProfile
);
const dataMessage = new textsecure.protobuf.DataMessage({ const dataMessage = new textsecure.protobuf.DataMessage({
profile, profile,
}); });

@ -715,7 +715,8 @@ $loading-height: 16px;
background: $color-loki-green-gradient; background: $color-loki-green-gradient;
border-radius: 100px; border-radius: 100px;
&:disabled, &:disabled:hover { &:disabled,
&:disabled:hover {
background: $color-loki-dark-gray; background: $color-loki-dark-gray;
cursor: default; cursor: default;
} }

Loading…
Cancel
Save