mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
Displaying placeholders when downloads are being fetched.
This commit is contained in:
parent
df0e04bd83
commit
c1bc72754a
2 changed files with 4 additions and 6 deletions
|
|
@ -313,8 +313,6 @@ class StoppableRow extends React.Component {
|
|||
export function Downloads() {
|
||||
useTitle('Downloads');
|
||||
|
||||
const {t} = useContext(ThemeContext);
|
||||
|
||||
const {onceDownloads, recurringDownloads, fetchDownloads} = useDownloads();
|
||||
|
||||
const tablePlaceholder = <Placeholder>
|
||||
|
|
@ -345,7 +343,7 @@ export function Downloads() {
|
|||
);
|
||||
|
||||
let onceTable = tablePlaceholder;
|
||||
if (_.isEmpty(onceDownloads)) {
|
||||
if (onceDownloads && _.isEmpty(onceDownloads)) {
|
||||
onceTable = <Segment>No downloads are scheduled.</Segment>
|
||||
} else if (onceDownloads) {
|
||||
onceTable = (
|
||||
|
|
@ -364,7 +362,7 @@ export function Downloads() {
|
|||
}
|
||||
|
||||
let recurringTable = tablePlaceholder;
|
||||
if (_.isEmpty(recurringDownloads)) {
|
||||
if (recurringDownloads && _.isEmpty(recurringDownloads)) {
|
||||
recurringTable = <Segment>No recurring downloads are scheduled.</Segment>
|
||||
} else if (recurringDownloads) {
|
||||
recurringTable = <Table>
|
||||
|
|
|
|||
|
|
@ -494,8 +494,8 @@ export const useHotspot = () => {
|
|||
}
|
||||
|
||||
export const useDownloads = () => {
|
||||
const [onceDownloads, setOnceDownloads] = useState();
|
||||
const [recurringDownloads, setRecurringDownloads] = useState();
|
||||
const [onceDownloads, setOnceDownloads] = useState(null);
|
||||
const [recurringDownloads, setRecurringDownloads] = useState(null);
|
||||
|
||||
const fetchDownloads = async () => {
|
||||
try {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue