Browse Source

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

j8
Mihai-Andrei Uscat 4 years ago
parent
commit
a7db7ecaff
No account linked to committer's email address

+ 7
- 3
react/features/chat/actions.web.js View File

20
  */
20
  */
21
 export function openChat(participant: Object) {
21
 export function openChat(participant: Object) {
22
     return function(dispatch: (Object) => Object) {
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
         } else {
41
         } else {
41
             dispatch(openChat());
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 View File

4
 
4
 
5
 import { translate } from '../../../base/i18n';
5
 import { translate } from '../../../base/i18n';
6
 import { connect } from '../../../base/redux';
6
 import { connect } from '../../../base/redux';
7
-import { toggleChat } from '../../actions.web';
8
 import AbstractChat, {
7
 import AbstractChat, {
9
     _mapStateToProps,
8
     _mapStateToProps,
10
     type Props
9
     type Props
52
         // Bind event handlers so they are only bound once for every instance.
51
         // Bind event handlers so they are only bound once for every instance.
53
         this._renderPanelContent = this._renderPanelContent.bind(this);
52
         this._renderPanelContent = this._renderPanelContent.bind(this);
54
         this._onChatInputResize = this._onChatInputResize.bind(this);
53
         this._onChatInputResize = this._onChatInputResize.bind(this);
55
-        this._onToggleChat = this._onToggleChat.bind(this);
56
     }
54
     }
57
 
55
 
58
     /**
56
     /**
137
      */
135
      */
138
     _renderChatHeader() {
136
     _renderChatHeader() {
139
         return (
137
         return (
140
-            <Header
141
-                className = 'chat-header'
142
-                onCancel = { this._onToggleChat } />
138
+            <Header className = 'chat-header' />
143
         );
139
         );
144
     }
140
     }
145
 
141
 
203
     }
199
     }
204
 
200
 
205
     _onSendMessage: (string) => void;
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
 export default translate(connect(_mapStateToProps)(Chat));
204
 export default translate(connect(_mapStateToProps)(Chat));

+ 2
- 2
react/features/chat/components/web/ChatDialogHeader.js View File

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

Loading…
Cancel
Save