1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

fix code smell: 'for loop should be for-of'

This commit is contained in:
Rares Tamasanu 2023-04-30 19:15:14 +01:00
parent 5977a33686
commit 2b9141f4cd
2 changed files with 11 additions and 14 deletions

View file

@ -679,9 +679,8 @@ function getCardTextLines(lines, cssClass, forceLines, isOuterFooter, cardLayout
let valid = 0;
for (let i = 0; i < lines.length; i++) {
for (const text of lines) {
let currentCssClass = cssClass;
const text = lines[i];
if (valid > 0 && isOuterFooter) {
currentCssClass += ' cardText-secondary';
@ -862,8 +861,8 @@ function getCardFooterText(item, apiClient, options, footerClass, progressHtml,
if (options.textLines) {
const additionalLines = options.textLines(item);
for (let i = 0; i < additionalLines.length; i++) {
lines.push(additionalLines[i]);
for (const additionalLine of additionalLines) {
lines.push(additionalLine);
}
}
@ -1724,8 +1723,7 @@ export function onTimerCreated(programId, newTimerId, itemsContainer) {
export function onTimerCancelled(timerId, itemsContainer) {
const cells = itemsContainer.querySelectorAll('.card[data-timerid="' + timerId + '"]');
for (let i = 0; i < cells.length; i++) {
const cell = cells[i];
for (const cell of cells) {
const icon = cell.querySelector('.timerIndicator');
if (icon) {
icon.parentNode.removeChild(icon);
@ -1742,8 +1740,7 @@ export function onTimerCancelled(timerId, itemsContainer) {
export function onSeriesTimerCancelled(cancelledTimerId, itemsContainer) {
const cells = itemsContainer.querySelectorAll('.card[data-seriestimerid="' + cancelledTimerId + '"]');
for (let i = 0; i < cells.length; i++) {
const cell = cells[i];
for (const cell of cells) {
const icon = cell.querySelector('.timerIndicator');
if (icon) {
icon.parentNode.removeChild(icon);