Merge pull request #6614 from SimonBrandner/fix/glare/18538
Fix glare related regressionspull/21833/head
commit
be18178015
|
@ -111,7 +111,7 @@ export default class CallView extends React.Component<IProps, IState> {
|
||||||
constructor(props: IProps) {
|
constructor(props: IProps) {
|
||||||
super(props);
|
super(props);
|
||||||
|
|
||||||
const { primary, secondary } = this.getOrderedFeeds(this.props.call.getFeeds());
|
const { primary, secondary } = CallView.getOrderedFeeds(this.props.call.getFeeds());
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
isLocalOnHold: this.props.call.isLocalOnHold(),
|
isLocalOnHold: this.props.call.isLocalOnHold(),
|
||||||
|
@ -147,7 +147,16 @@ export default class CallView extends React.Component<IProps, IState> {
|
||||||
dis.unregister(this.dispatcherRef);
|
dis.unregister(this.dispatcherRef);
|
||||||
}
|
}
|
||||||
|
|
||||||
public componentDidUpdate(prevProps) {
|
static getDerivedStateFromProps(props: IProps): Partial<IState> {
|
||||||
|
const { primary, secondary } = CallView.getOrderedFeeds(props.call.getFeeds());
|
||||||
|
|
||||||
|
return {
|
||||||
|
primaryFeed: primary,
|
||||||
|
secondaryFeeds: secondary,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public componentDidUpdate(prevProps: IProps): void {
|
||||||
if (this.props.call === prevProps.call) return;
|
if (this.props.call === prevProps.call) return;
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
|
@ -201,7 +210,7 @@ export default class CallView extends React.Component<IProps, IState> {
|
||||||
};
|
};
|
||||||
|
|
||||||
private onFeedsChanged = (newFeeds: Array<CallFeed>) => {
|
private onFeedsChanged = (newFeeds: Array<CallFeed>) => {
|
||||||
const { primary, secondary } = this.getOrderedFeeds(newFeeds);
|
const { primary, secondary } = CallView.getOrderedFeeds(newFeeds);
|
||||||
this.setState({
|
this.setState({
|
||||||
primaryFeed: primary,
|
primaryFeed: primary,
|
||||||
secondaryFeeds: secondary,
|
secondaryFeeds: secondary,
|
||||||
|
@ -226,7 +235,7 @@ export default class CallView extends React.Component<IProps, IState> {
|
||||||
this.buttonsRef.current?.showControls();
|
this.buttonsRef.current?.showControls();
|
||||||
};
|
};
|
||||||
|
|
||||||
private getOrderedFeeds(feeds: Array<CallFeed>): { primary: CallFeed, secondary: Array<CallFeed> } {
|
static getOrderedFeeds(feeds: Array<CallFeed>): { primary: CallFeed, secondary: Array<CallFeed> } {
|
||||||
let primary;
|
let primary;
|
||||||
|
|
||||||
// Try to use a screensharing as primary, a remote one if possible
|
// Try to use a screensharing as primary, a remote one if possible
|
||||||
|
|
Loading…
Reference in New Issue