Final type fixes
Revert previous type import hack and type a couple more bits
This commit is contained in:
parent
446fd9c7c0
commit
cf9625f33e
2 changed files with 23 additions and 6 deletions
17
src/@types/global.d.ts
vendored
Normal file
17
src/@types/global.d.ts
vendored
Normal file
|
@ -0,0 +1,17 @@
|
|||
/*
|
||||
Copyright 2022 Matrix.org Foundation C.I.C.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import "matrix-js-sdk/src/@types/global";
|
|
@ -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]);
|
||||
|
|
Loading…
Add table
Reference in a new issue