Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #6622 from SimonBrandner/release/fix/glare/18538
Browse files Browse the repository at this point in the history
[Release] Fix glare related regressions
  • Loading branch information
dbkr committed Aug 16, 2021
2 parents ed7dea9 + 8770317 commit 891e9b5
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/components/views/voip/CallView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export default class CallView extends React.Component<IProps, IState> {
constructor(props: IProps) {
super(props);

const { primary, secondary } = this.getOrderedFeeds(this.props.call.getFeeds());
const { primary, secondary } = CallView.getOrderedFeeds(this.props.call.getFeeds());

this.state = {
isLocalOnHold: this.props.call.isLocalOnHold(),
Expand Down Expand Up @@ -166,7 +166,16 @@ export default class CallView extends React.Component<IProps, IState> {
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;

this.setState({
Expand Down Expand Up @@ -220,7 +229,7 @@ export default class CallView extends React.Component<IProps, IState> {
};

private onFeedsChanged = (newFeeds: Array<CallFeed>) => {
const { primary, secondary } = this.getOrderedFeeds(newFeeds);
const { primary, secondary } = CallView.getOrderedFeeds(newFeeds);
this.setState({
primaryFeed: primary,
secondaryFeeds: secondary,
Expand Down Expand Up @@ -253,7 +262,7 @@ export default class CallView extends React.Component<IProps, IState> {
this.showControls();
};

private getOrderedFeeds(feeds: Array<CallFeed>): { primary: CallFeed, secondary: Array<CallFeed> } {
static getOrderedFeeds(feeds: Array<CallFeed>): { primary: CallFeed, secondary: Array<CallFeed> } {
let primary;

// Try to use a screensharing as primary, a remote one if possible
Expand Down

0 comments on commit 891e9b5

Please sign in to comment.