use querySelectorAll

This commit is contained in:
silverwind 2024-04-30 15:58:24 +02:00
parent 729864b015
commit 9c0be40547
No known key found for this signature in database
GPG Key ID: 2E62B41C93869443
1 changed files with 3 additions and 3 deletions

View File

@ -126,9 +126,9 @@ async function updateStopwatch() {
function updateStopwatchData(data) {
const watch = data[0];
const btnEl = document.querySelector('.active-stopwatch');
const btnEls = document.querySelectorAll('.active-stopwatch');
if (!watch) {
hideElem(btnEl);
hideElem(btnEls);
} else {
const {repo_owner_name, repo_name, issue_index, seconds} = watch;
const issueUrl = `${appSubUrl}/${repo_owner_name}/${repo_name}/issues/${issue_index}`;
@ -138,7 +138,7 @@ function updateStopwatchData(data) {
const stopwatchIssue = document.querySelector('.stopwatch-issue');
if (stopwatchIssue) stopwatchIssue.textContent = `${repo_owner_name}/${repo_name}#${issue_index}`;
updateStopwatchTime(seconds);
showElem(btnEl);
showElem(btnEls);
}
return Boolean(data.length);
}