Fix waiting state not disappearing after the 20 second timeout
This commit is contained in:
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import React from "react";
|
||||
import React, { useEffect } from "react";
|
||||
import useMeasure from "react-use-measure";
|
||||
import { ResizeObserver } from "@juggle/resize-observer";
|
||||
import { GroupCall, MatrixClient, RoomMember } from "matrix-js-sdk";
|
||||
@@ -142,8 +142,7 @@ export const PTTCallView: React.FC<Props> = ({
|
||||
const networkWaiting =
|
||||
talkingExpected && !activeSpeakerUserId && !showTalkOverError;
|
||||
|
||||
const activeSpeakerIsLocalUser =
|
||||
activeSpeakerUserId && client.getUserId() === activeSpeakerUserId;
|
||||
const activeSpeakerIsLocalUser = activeSpeakerUserId === client.getUserId();
|
||||
const activeSpeakerUser = activeSpeakerUserId
|
||||
? client.getUser(activeSpeakerUserId)
|
||||
: null;
|
||||
@@ -152,6 +151,10 @@ export const PTTCallView: React.FC<Props> = ({
|
||||
? activeSpeakerUser.displayName
|
||||
: "";
|
||||
|
||||
useEffect(() => {
|
||||
setTalkingExpected(activeSpeakerIsLocalUser);
|
||||
}, [activeSpeakerIsLocalUser, setTalkingExpected]);
|
||||
|
||||
return (
|
||||
<div className={styles.pttCallView} ref={containerRef}>
|
||||
<PTTClips
|
||||
|
||||
Reference in New Issue
Block a user