From 34112c79c7d22e75b13086f7e361ab4bab96fabe Mon Sep 17 00:00:00 2001 From: josc146 Date: Wed, 29 Nov 2023 15:28:43 +0800 Subject: [PATCH] fix autoPlayed midi cannot be stopped --- frontend/src/pages/Composition.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/pages/Composition.tsx b/frontend/src/pages/Composition.tsx index 6d24e32..0c3739f 100644 --- a/frontend/src/pages/Composition.tsx +++ b/frontend/src/pages/Composition.tsx @@ -128,7 +128,9 @@ const CompositionPanel: FC = observer(() => { }); updateNs(ns); if (autoPlay) { - playerRef.current?.start(); + setTimeout(() => { + playerRef.current?.start(); + }); } }); });