From 828aa4413f1ea14763d3fe4d89581233e6bf866b Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Tue, 17 Nov 2020 16:46:04 +1100 Subject: [PATCH] remove unused group_member_list component --- background.html | 8 ----- background_test.html | 7 ---- js/views/contact_list_view.js | 57 ------------------------------ js/views/group_member_list_view.js | 41 --------------------- stylesheets/_global.scss | 1 - test/index.html | 8 ----- ts/session/snode_api/onions.ts | 4 +-- 7 files changed, 2 insertions(+), 124 deletions(-) delete mode 100644 js/views/contact_list_view.js delete mode 100644 js/views/group_member_list_view.js diff --git a/background.html b/background.html index 55088b7dd..fb2122b85 100644 --- a/background.html +++ b/background.html @@ -63,12 +63,6 @@ Sorry, your attachment has a type, {{type}}, that is not currently supported. - - - - diff --git a/background_test.html b/background_test.html index 68bc4e763..fe1fcf49c 100644 --- a/background_test.html +++ b/background_test.html @@ -62,11 +62,6 @@ Sorry, your attachment has a type, {{type}}, that is not currently supported. - - - diff --git a/js/views/contact_list_view.js b/js/views/contact_list_view.js deleted file mode 100644 index 631ec390d..000000000 --- a/js/views/contact_list_view.js +++ /dev/null @@ -1,57 +0,0 @@ -/* global Whisper: false */ -/* global textsecure: false */ - -// eslint-disable-next-line func-names -(function() { - 'use strict'; - - window.Whisper = window.Whisper || {}; - - Whisper.ContactListView = Whisper.ListView.extend({ - tagName: 'div', - itemView: Whisper.View.extend({ - tagName: 'div', - className: 'contact', - templateName: 'contact', - initialize(options) { - this.ourNumber = textsecure.storage.user.getNumber(); - this.listenBack = options.listenBack; - - this.listenTo(this.model, 'change', this.render); - }, - render() { - if (this.contactView) { - this.contactView.remove(); - this.contactView = null; - } - - const isMe = this.ourNumber === this.model.id; - - this.contactView = new Whisper.ReactWrapperView({ - className: 'contact-wrapper', - Component: window.Signal.Components.ContactListItem, - props: { - isMe, - avatarPath: this.model.getAvatarPath(), - phoneNumber: this.model.getNumber(), - name: this.model.getName(), - profileName: this.model.getProfileName(), - verified: this.model.isVerified(), - onClick: this.showIdentity.bind(this), - }, - }); - this.$el.append(this.contactView.el); - return this; - }, - showIdentity() { - if (this.model.id === this.ourNumber) { - return; - } - const view = new Whisper.KeyVerificationPanelView({ - model: this.model, - }); - this.listenBack(view); - }, - }), - }); -})(); diff --git a/js/views/group_member_list_view.js b/js/views/group_member_list_view.js deleted file mode 100644 index 50a121cdc..000000000 --- a/js/views/group_member_list_view.js +++ /dev/null @@ -1,41 +0,0 @@ -/* global Whisper, i18n */ - -// eslint-disable-next-line func-names -(function() { - 'use strict'; - - window.Whisper = window.Whisper || {}; - - // TODO: take a title string which could replace the 'members' header - Whisper.GroupMemberList = Whisper.View.extend({ - className: 'group-member-list panel', - templateName: 'group-member-list', - initialize(options) { - this.needVerify = options.needVerify; - - this.render(); - - this.member_list_view = new Whisper.ContactListView({ - collection: this.model, - className: 'members', - toInclude: { - listenBack: options.listenBack, - }, - }); - this.member_list_view.render(); - - this.$('.container').append(this.member_list_view.el); - }, - render_attributes() { - let summary; - if (this.needVerify) { - summary = i18n('membersNeedingVerification'); - } - - return { - members: i18n('groupMembers'), - summary, - }; - }, - }); -})(); diff --git a/stylesheets/_global.scss b/stylesheets/_global.scss index 3013d62e4..a669584f7 100644 --- a/stylesheets/_global.scss +++ b/stylesheets/_global.scss @@ -152,7 +152,6 @@ a { } } -.group-member-list, .new-group-update { .summary { margin: 10px; diff --git a/test/index.html b/test/index.html index ee1b62371..d81f15be4 100644 --- a/test/index.html +++ b/test/index.html @@ -99,12 +99,6 @@ Sorry, your attachment has a type, {{type}}, that is not currently supported. - - - - diff --git a/ts/session/snode_api/onions.ts b/ts/session/snode_api/onions.ts index df0ecbb9a..6645e46a9 100644 --- a/ts/session/snode_api/onions.ts +++ b/ts/session/snode_api/onions.ts @@ -361,7 +361,7 @@ const sendOnionRequest = async ( finalDestOptions: any, finalRelayOptions?: any, lsrpcIdx?: any -) => { +): Promise => { const { log, StringView } = window; let id = ''; @@ -489,7 +489,7 @@ export async function sendOnionRequestLsrpcDest( host: any, payloadObj: any, lsrpcIdx: number -) { +): Promise { return sendOnionRequest( reqIdx, nodePath,