-
Notifications
You must be signed in to change notification settings - Fork 8
Mv 286 tile switching #182
base: master
Are you sure you want to change the base?
Conversation
hasSpoken(mediaPlayerId) || isSpeaking ? "speaking" : "rest" | ||
)(remoteTiles); | ||
const newSpeakingTiles = (speaking ?? []).filter(({ mediaPlayerId }) => !hasSpoken(mediaPlayerId)); | ||
newSpeakingTiles.map(({ mediaPlayerId }) => mediaPlayerId).forEach(addToHistory); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The date is refreshed only for new tiles so "old speaking" participants can be hidden.
const getTimeLastSpoken = useCallback((tileId: string) => speakingHistory.get(tileId) ?? 0, [speakingHistory]); | ||
const addToHistory = useCallback( | ||
(tileId: string) => { | ||
if (!hasSpoken(tileId)) setSpeakingHistory((oldHistory) => new Map(oldHistory).set(tileId, Date.now())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about the ones who have spoken before? Why you're not updating their "last spoken time"?
}; | ||
|
||
const { localTiles, remoteTiles, screenshareTiles } = groupBy(({ typeName }: MediaPlayerTileConfig) => | ||
typeName === "local" ? "localTiles" : typeName === "remote" ? "remoteTiles" : "screenshareTiles" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO this would be more readable with switch
Please make sure to align this change with the agreed design: https://docs.google.com/document/d/1HBr-Qf6IgtYPYMAaw7ZF3RzlElASf15LtKl2eO7EX9I/edit?usp=sharing |
This PR adds switching of the Last Recently Spoken person.
The desired state of the unpinned tiles is: