瀏覽代碼

fix(contact-list): call getAvatarURL directly

Instead of going through the Avatar object, call the getAvatarURL
directly so that the code flows consistently use the participant
representation within redux.
j8
Leonard Kim 8 年之前
父節點
當前提交
4b2795502c
共有 1 個檔案被更改,包括 8 行新增7 行删除
  1. 8
    7
      react/features/contact-list/components/ContactListPanel.web.js

+ 8
- 7
react/features/contact-list/components/ContactListPanel.web.js 查看文件

@@ -2,10 +2,8 @@ import Button from '@atlaskit/button';
2 2
 import React, { Component } from 'react';
3 3
 import { connect } from 'react-redux';
4 4
 
5
-import Avatar from '../../../../modules/UI/avatar/Avatar';
6
-
7 5
 import { translate } from '../../base/i18n';
8
-import { getParticipants } from '../../base/participants';
6
+import { getAvatarURL, getParticipants } from '../../base/participants';
9 7
 import { openInviteDialog } from '../../invite';
10 8
 
11 9
 import ContactListItem from './ContactListItem';
@@ -114,15 +112,18 @@ class ContactListPanel extends Component {
114 112
      * @returns {ReactElement[]}
115 113
      */
116 114
     _renderContacts() {
117
-        return this.props._participants.map(({ avatarId, id, name }) =>
118
-            ( // eslint-disable-line no-extra-parens
115
+        return this.props._participants.map(participant => {
116
+            const { id, name } = participant;
117
+
118
+            return (
119 119
                 <ContactListItem
120 120
                     avatarURI = { interfaceConfig.SHOW_CONTACTLIST_AVATARS
121
-                        ? Avatar.getAvatarUrl(avatarId) : null }
121
+                        ? getAvatarURL(participant) : null }
122 122
                     id = { id }
123 123
                     key = { id }
124 124
                     name = { name } />
125
-            ));
125
+            );
126
+        });
126 127
     }
127 128
 
128 129
     /**

Loading…
取消
儲存