Combine recent raised hands into existing toast

This commit is contained in:
ayumi-signal 2024-01-12 19:44:44 -08:00 committed by GitHub
parent b0b12d4224
commit b574ba531d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 60 additions and 31 deletions

View file

@ -3,7 +3,7 @@
import type { ReactNode } from 'react';
import React, { useState, useRef, useEffect, useCallback } from 'react';
import { isEqual, noop } from 'lodash';
import { isEqual, noop, sortBy } from 'lodash';
import classNames from 'classnames';
import type { VideoFrameSource } from '@signalapp/ringrtc';
import type {
@ -520,7 +520,10 @@ export function CallScreen({
const renderRaisedHandsToast = React.useCallback(
(hands: Array<number>) => {
const names = hands.map(demuxId =>
// Sort "You" to the front.
const names = sortBy(hands, demuxId =>
demuxId === localDemuxId ? 0 : 1
).map(demuxId =>
demuxId === localDemuxId
? i18n('icu:you')
: conversationsByDemuxId.get(demuxId)?.title