Final type fixes

Revert previous type import hack and type a couple more bits
This commit is contained in:
David Baker
2022-05-10 17:18:26 +01:00
parent 446fd9c7c0
commit cf9625f33e
2 changed files with 23 additions and 6 deletions

View File

@@ -16,11 +16,8 @@ limitations under the License.
import { useCallback, useEffect, useState } from "react";
import { MatrixClient } from "matrix-js-sdk/src/client";
// XXX: This must come after the other js-sdk import because of
// https://github.com/matrix-org/matrix-js-sdk/issues/2351
import "matrix-js-sdk/src/@types/global";
import { GroupCall } from "matrix-js-sdk/src/webrtc/groupCall";
import { CallFeed } from "matrix-js-sdk/src/webrtc/callFeed";
import { CallFeed, CallFeedEvent } from "matrix-js-sdk/src/webrtc/callFeed";
export interface PTTState {
pttButtonHeld: boolean;
@@ -74,7 +71,7 @@ export const usePTT = (
}
for (const callFeed of userMediaFeeds) {
callFeed.addListener("mute_state_changed", onMuteStateChanged);
callFeed.addListener(CallFeedEvent.MuteStateChanged, onMuteStateChanged);
}
const activeSpeakerFeed = userMediaFeeds.find((f) => !f.isAudioMuted());
@@ -86,7 +83,10 @@ export const usePTT = (
return () => {
for (const callFeed of userMediaFeeds) {
callFeed.removeListener("mute_state_changed", onMuteStateChanged);
callFeed.removeListener(
CallFeedEvent.MuteStateChanged,
onMuteStateChanged
);
}
};
}, [userMediaFeeds]);