Simplify and lint

This commit is contained in:
sachaaaaa 2019-09-03 16:42:12 +10:00
parent e50a29ffa5
commit ef6b22f6b9
4 changed files with 13 additions and 9 deletions

View file

@ -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();

View file

@ -208,7 +208,8 @@
countDownCallBack();
this.pairingInterval = setInterval(countDownCallBack, 1000);
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(' ')
.slice(-3)
.join(' ');

View file

@ -110,7 +110,9 @@
'private'
);
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({
profile,
});

View file

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