Skip to content

Commit

Permalink
fix(renderer-app): fix rtc avatar missing init state (#1544)
Browse files Browse the repository at this point in the history
  • Loading branch information
crimx authored May 31, 2022
1 parent 47778f6 commit f0e620d
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import "./AvatarCanvas.less";

import React, { useCallback, useEffect } from "react";
import { observer } from "mobx-react-lite";
import { useUpdateEffect } from "react-use";
import { FlatRTCAvatar } from "@netless/flat-rtc";
import { User } from "../../stores/class-room-store";

Expand All @@ -24,11 +23,11 @@ export const AvatarCanvas = observer<
return rtcAvatar?.getVolumeLevel() || 0;
}, [rtcAvatar]);

useUpdateEffect(() => {
useEffect(() => {
rtcAvatar?.enableCamera(avatarUser.camera);
}, [rtcAvatar, avatarUser.camera]);

useUpdateEffect(() => {
useEffect(() => {
rtcAvatar?.enableMic(avatarUser.mic);
}, [rtcAvatar, avatarUser.mic]);

Expand Down

0 comments on commit f0e620d

Please sign in to comment.