Skip to content

Commit cdb8b23

Browse files
committed
fix:record button disable on play button run
1 parent 37df3bc commit cdb8b23

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

js/toolbar.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@ class Toolbar {
357357
const stopIcon = docById("stop");
358358

359359
let isPlayIconRunning = false;
360+
const recordButton = docById("record");
360361

361362
function handleClick() {
362363
if (!isPlayIconRunning) {
@@ -365,6 +366,9 @@ class Toolbar {
365366
saveButtonAdvanced.disabled = true;
366367
saveButton.className = "grey-text inactiveLink";
367368
saveButtonAdvanced.className = "grey-text inactiveLink";
369+
recordButton._tempOnClick = recordButton.onclick;
370+
recordButton.onclick = null;
371+
recordButton.style.opacity = "0.4";
368372
// eslint-disable-next-line no-console
369373
console.log("Wait for next 2 seconds to play the music");
370374
} else {
@@ -375,6 +379,8 @@ class Toolbar {
375379
saveButtonAdvanced.disabled = false;
376380
saveButton.className = "";
377381
saveButtonAdvanced.className = "";
382+
recordButton.onclick = recordButton._tempOnClick;
383+
recordButton.style.opacity = "1";
378384
}
379385
}
380386

0 commit comments

Comments
 (0)