Sfoglia il codice sorgente

Chat render improbement

master
Bettenbuk Zoltan 6 anni fa
parent
commit
230b2b02fa
1 ha cambiato i file con 4 aggiunte e 6 eliminazioni
  1. 4
    6
      react/features/chat/components/native/Chat.js

+ 4
- 6
react/features/chat/components/native/Chat.js Vedi File

51
      * @inheritdoc
51
      * @inheritdoc
52
      */
52
      */
53
     render() {
53
     render() {
54
-        const messages = this.props._messages.map(this._transformMessage);
54
+        // Gifted chat requires a special object format and a reversed list
55
+        // of messages.
56
+        const messages
57
+            = this.props._messages.map(this._transformMessage).reverse();
55
         const modalStyle = [
58
         const modalStyle = [
56
             styles.modalBackdrop
59
             styles.modalBackdrop
57
         ];
60
         ];
156
 
159
 
157
     return {
160
     return {
158
         ...abstractReduxProps,
161
         ...abstractReduxProps,
159
-
160
-        // Gifted chat requires the messages to be reverse ordered.
161
-        _messages: [
162
-            ...abstractReduxProps._messages
163
-        ].reverse(),
164
         _solidBackground: state['features/base/conference'].audioOnly
162
         _solidBackground: state['features/base/conference'].audioOnly
165
     };
163
     };
166
 }
164
 }

Loading…
Annulla
Salva