Don't show toolbar buttons on connecting tiles
Because connecting tiles don't have a feed, clicking the local volume button would cause a soft crash. This also fixes a few strict mode errors in the surrounding area while we're at it.
This commit is contained in:
@@ -19,17 +19,18 @@ import { CallFeed, CallFeedEvent } from "matrix-js-sdk/src/webrtc/callFeed";
|
||||
import { SDPStreamMetadataPurpose } from "matrix-js-sdk/src/webrtc/callEventTypes";
|
||||
|
||||
interface CallFeedState {
|
||||
callFeed: CallFeed;
|
||||
callFeed: CallFeed | undefined;
|
||||
isLocal: boolean;
|
||||
speaking: boolean;
|
||||
videoMuted: boolean;
|
||||
audioMuted: boolean;
|
||||
localVolume: number;
|
||||
disposed: boolean;
|
||||
stream: MediaStream;
|
||||
purpose: SDPStreamMetadataPurpose;
|
||||
disposed: boolean | undefined;
|
||||
stream: MediaStream | undefined;
|
||||
purpose: SDPStreamMetadataPurpose | undefined;
|
||||
}
|
||||
function getCallFeedState(callFeed: CallFeed): CallFeedState {
|
||||
|
||||
function getCallFeedState(callFeed: CallFeed | undefined): CallFeedState {
|
||||
return {
|
||||
callFeed,
|
||||
isLocal: callFeed ? callFeed.isLocal() : false,
|
||||
@@ -43,7 +44,7 @@ function getCallFeedState(callFeed: CallFeed): CallFeedState {
|
||||
};
|
||||
}
|
||||
|
||||
export function useCallFeed(callFeed: CallFeed): CallFeedState {
|
||||
export function useCallFeed(callFeed: CallFeed | undefined): CallFeedState {
|
||||
const [state, setState] = useState<CallFeedState>(() =>
|
||||
getCallFeedState(callFeed)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user