Selaa lähdekoodia

fix(LargeVideo): Fix large video not resizing when closing chat.

j8
Mihai-Andrei Uscat 4 vuotta sitten
vanhempi
commit
a7db7ecaff
No account linked to committer's email address

+ 7
- 3
react/features/chat/actions.web.js Näytä tiedosto

@@ -20,9 +20,10 @@ export * from './actions.any';
20 20
  */
21 21
 export function openChat(participant: Object) {
22 22
     return function(dispatch: (Object) => Object) {
23
-        dispatch({ participant,
24
-            type: OPEN_CHAT });
25
-        VideoLayout.onResize();
23
+        dispatch({
24
+            participant,
25
+            type: OPEN_CHAT
26
+        });
26 27
     };
27 28
 }
28 29
 
@@ -40,5 +41,8 @@ export function toggleChat() {
40 41
         } else {
41 42
             dispatch(openChat());
42 43
         }
44
+
45
+        // Recompute the large video size whenever we toggle the chat, as it takes chat state into account.
46
+        VideoLayout.onResize();
43 47
     };
44 48
 }

+ 1
- 17
react/features/chat/components/web/Chat.js Näytä tiedosto

@@ -4,7 +4,6 @@ import React from 'react';
4 4
 
5 5
 import { translate } from '../../../base/i18n';
6 6
 import { connect } from '../../../base/redux';
7
-import { toggleChat } from '../../actions.web';
8 7
 import AbstractChat, {
9 8
     _mapStateToProps,
10 9
     type Props
@@ -52,7 +51,6 @@ class Chat extends AbstractChat<Props> {
52 51
         // Bind event handlers so they are only bound once for every instance.
53 52
         this._renderPanelContent = this._renderPanelContent.bind(this);
54 53
         this._onChatInputResize = this._onChatInputResize.bind(this);
55
-        this._onToggleChat = this._onToggleChat.bind(this);
56 54
     }
57 55
 
58 56
     /**
@@ -137,9 +135,7 @@ class Chat extends AbstractChat<Props> {
137 135
      */
138 136
     _renderChatHeader() {
139 137
         return (
140
-            <Header
141
-                className = 'chat-header'
142
-                onCancel = { this._onToggleChat } />
138
+            <Header className = 'chat-header' />
143 139
         );
144 140
     }
145 141
 
@@ -203,18 +199,6 @@ class Chat extends AbstractChat<Props> {
203 199
     }
204 200
 
205 201
     _onSendMessage: (string) => void;
206
-
207
-    _onToggleChat: () => void;
208
-
209
-    /**
210
-    * Toggles the chat window.
211
-    *
212
-    * @returns {Function}
213
-    */
214
-    _onToggleChat() {
215
-        this.props.dispatch(toggleChat());
216
-    }
217
-
218 202
 }
219 203
 
220 204
 export default translate(connect(_mapStateToProps)(Chat));

+ 2
- 2
react/features/chat/components/web/ChatDialogHeader.js Näytä tiedosto

@@ -5,7 +5,7 @@ import React from 'react';
5 5
 import { translate } from '../../../base/i18n';
6 6
 import { Icon, IconClose } from '../../../base/icons';
7 7
 import { connect } from '../../../base/redux';
8
-import { closeChat } from '../../actions.any';
8
+import { toggleChat } from '../../actions.web';
9 9
 
10 10
 type Props = {
11 11
 
@@ -42,6 +42,6 @@ function Header({ onCancel, className, t }: Props) {
42 42
     );
43 43
 }
44 44
 
45
-const mapDispatchToProps = { onCancel: closeChat };
45
+const mapDispatchToProps = { onCancel: toggleChat };
46 46
 
47 47
 export default translate(connect(null, mapDispatchToProps)(Header));

Loading…
Peruuta
Tallenna