mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
Creating isEmpty function to check if dict/array have some contents.
This commit is contained in:
parent
92bd1de8a0
commit
dad276d6ec
10 changed files with 189 additions and 159 deletions
|
|
@ -2,7 +2,7 @@ import React, {useContext} from "react";
|
|||
import {clearCompletedDownloads, clearFailedDownloads, killDownload, postDownload} from "../../api";
|
||||
import {Link} from "react-router-dom";
|
||||
import {
|
||||
DisableDownloadsToggle,
|
||||
DisableDownloadsToggle, isEmpty,
|
||||
secondsToElapsedPopup,
|
||||
secondsToFrequency,
|
||||
textEllipsis,
|
||||
|
|
@ -301,7 +301,7 @@ export function Downloads() {
|
|||
);
|
||||
|
||||
let onceTable = tablePlaceholder;
|
||||
if (onceDownloads && onceDownloads.length === 0) {
|
||||
if (isEmpty(onceDownloads)) {
|
||||
onceTable = <p {...t}>No downloads are scheduled.</p>
|
||||
} else if (onceDownloads) {
|
||||
onceTable = (
|
||||
|
|
@ -320,7 +320,7 @@ export function Downloads() {
|
|||
}
|
||||
|
||||
let recurringTable = tablePlaceholder;
|
||||
if (recurringDownloads && recurringDownloads.length === 0) {
|
||||
if (isEmpty(recurringDownloads)) {
|
||||
recurringTable = <p {...t}>No recurring downloads are scheduled.</p>
|
||||
} else if (recurringDownloads) {
|
||||
recurringTable = <Table>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue