More hacking on rtcsession

This commit is contained in:
David Baker
2023-08-18 09:03:21 +01:00
parent 1716bd4418
commit e39d00154d
7 changed files with 196 additions and 85 deletions

View File

@@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { logger } from "matrix-js-sdk/src/logger";
import {
MatrixRTCSession,
MatrixRTCSessionEvent,
@@ -26,6 +27,11 @@ export function useMatrixRTCSessionJoinState(
const [isJoined, setJoined] = useState(rtcSession.isJoined());
const onJoinStateChanged = useCallback(() => {
logger.info(
`Session in room ${rtcSession.room.roomId} changed to ${
rtcSession.isJoined() ? "joined" : "left"
}`
);
setJoined(rtcSession.isJoined());
}, [rtcSession]);