mirror of
https://github.com/element-hq/element-call.git
synced 2026-10-23 15:12:35 +00:00
Draw the microphone level without re-rendering
- The level state carries a Behavior, so the state changes only when its kind does. - The meter renders its bars once and an effect draws the level into them. - The render-counting test now counts every commit, and asserts none while the level moves. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
02a49928b0
commit
2aa7ff6ccc
8 files changed
+101
-59
No files matched your search
@@ -35,6 +35,7 @@ describe("useMicrophoneLevel", () => {
|
||||
rerender({ id: "mic2" });
|
||||
|
||||
// No level carried over from the previous device.
|
||||
expect(result.current).toEqual({ type: "level", level: 0 });
|
||||
const state = result.current;
|
||||
expect(state.type === "level" ? state.level.value : state.type).toBe(0);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user