From ef6b22f6b900cd91c1310c159c1de0e0fcc9ed6f Mon Sep 17 00:00:00 2001 From: sachaaaaa Date: Tue, 3 Sep 2019 16:42:12 +1000 Subject: [PATCH] Simplify and lint --- js/views/device_pairing_dialog_view.js | 12 ++++++------ js/views/standalone_registration_view.js | 3 ++- libloki/api.js | 4 +++- stylesheets/_global.scss | 3 ++- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/js/views/device_pairing_dialog_view.js b/js/views/device_pairing_dialog_view.js index 68e1b426d..b8235826d 100644 --- a/js/views/device_pairing_dialog_view.js +++ b/js/views/device_pairing_dialog_view.js @@ -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(); diff --git a/js/views/standalone_registration_view.js b/js/views/standalone_registration_view.js index cc9489a2c..05fa385d6 100644 --- a/js/views/standalone_registration_view.js +++ b/js/views/standalone_registration_view.js @@ -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(' '); diff --git a/libloki/api.js b/libloki/api.js index 6d9faa579..66e63458b 100644 --- a/libloki/api.js +++ b/libloki/api.js @@ -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, }); diff --git a/stylesheets/_global.scss b/stylesheets/_global.scss index cd3628cd0..dcac219a0 100644 --- a/stylesheets/_global.scss +++ b/stylesheets/_global.scss @@ -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; }