Peek group calls when opening conversations and leaving calls
This commit is contained in:
parent
5ce26eb91a
commit
f5a4cd9ce8
13 changed files with 202 additions and 373 deletions
|
@ -170,6 +170,7 @@ export type PropsActionsType = {
|
|||
onBlockAndReportSpam: (conversationId: string) => unknown;
|
||||
onDelete: (conversationId: string) => unknown;
|
||||
onUnblock: (conversationId: string) => unknown;
|
||||
peekGroupCallForTheFirstTime: (conversationId: string) => unknown;
|
||||
removeMember: (conversationId: string) => unknown;
|
||||
selectMessage: (messageId: string, conversationId: string) => unknown;
|
||||
clearSelectedMessage: () => unknown;
|
||||
|
@ -263,6 +264,7 @@ const getActions = createSelector(
|
|||
'onBlockAndReportSpam',
|
||||
'onDelete',
|
||||
'onUnblock',
|
||||
'peekGroupCallForTheFirstTime',
|
||||
'removeMember',
|
||||
'selectMessage',
|
||||
'clearSelectedMessage',
|
||||
|
@ -327,6 +329,8 @@ export class Timeline extends React.PureComponent<PropsType, StateType> {
|
|||
|
||||
private hasRecentlyScrolledTimeout?: NodeJS.Timeout;
|
||||
|
||||
private delayedPeekTimeout?: NodeJS.Timeout;
|
||||
|
||||
private containerRefMerger = createRefMerger();
|
||||
|
||||
constructor(props: PropsType) {
|
||||
|
@ -958,10 +962,21 @@ export class Timeline extends React.PureComponent<PropsType, StateType> {
|
|||
public override componentDidMount(): void {
|
||||
this.updateWithVisibleRows();
|
||||
window.registerForActive(this.updateWithVisibleRows);
|
||||
|
||||
this.delayedPeekTimeout = setTimeout(() => {
|
||||
const { id, peekGroupCallForTheFirstTime } = this.props;
|
||||
peekGroupCallForTheFirstTime(id);
|
||||
}, 500);
|
||||
}
|
||||
|
||||
public override componentWillUnmount(): void {
|
||||
const { delayedPeekTimeout } = this;
|
||||
|
||||
window.unregisterForActive(this.updateWithVisibleRows);
|
||||
|
||||
if (delayedPeekTimeout) {
|
||||
clearTimeout(delayedPeekTimeout);
|
||||
}
|
||||
}
|
||||
|
||||
public override componentDidUpdate(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue