Skip to content

Commit 697bccb

Browse files
committed
refactor: remove unnecessary audio player subscription registration when no player is available
1 parent 5fc049e commit 697bccb

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/components/AudioPlayer/WithAudioPlayback.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ const audioPlayers = new AudioPlayerPool();
1010
export type WithAudioPlaybackProps = { children?: ReactNode };
1111

1212
export const WithAudioPlayback = ({ children }: WithAudioPlaybackProps) => {
13-
useEffect(() => {
14-
audioPlayers.registerSubscriptions();
15-
return () => {
13+
useEffect(
14+
() => () => {
1615
audioPlayers.clear();
17-
};
18-
}, []);
16+
},
17+
[],
18+
);
1919

2020
return children;
2121
};

0 commit comments

Comments
 (0)