Skip to content

Commit

Permalink
Add empty check for historical data view
Browse files Browse the repository at this point in the history
  • Loading branch information
ugyballoons committed Jul 23, 2024
1 parent 56c41a3 commit 06556a9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/js/components/TableApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ export default function TableApp ({ camera, initialDate, initialChannelData, ini
}
}, [date]) // Only reattach the event listener if the date changes

if (Object.entries(metadata).length + Object.entries(channelData).length == 0) {
return (
<h3>There is no data for this day</h3>
)
}
return (
<div className="table-container">
<div className="above-table-sticky">
Expand Down
2 changes: 1 addition & 1 deletion src/js/components/TableView.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect } from 'react'
import React from 'react'
import PropTypes from 'prop-types'
import { indicatorForAttr, _elWithClass, _elWithAttrs, replaceInString, _getById } from '../modules/utils'
import { metadatumType } from './componentPropTypes'
Expand Down

0 comments on commit 06556a9

Please sign in to comment.