Skip to content

Commit

Permalink
Fix issues for display of no nfc items found
Browse files Browse the repository at this point in the history
  • Loading branch information
ligangty committed Feb 6, 2024
1 parent 0aa7ead commit 220fb7e
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions src/main/webui/src/app/components/content/addons/NFC.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ export default function NFC() {
const labelSections = secs => {
secs.forEach(s => {
s.label = Utils.keyLabel(s.key);
s.paths.sort();
if(s.paths && s.paths.length > 1){
s.paths.sort();
}
});
};

Expand Down Expand Up @@ -297,8 +299,9 @@ export default function NFC() {
{error && error.trim() !== "" && <div className="alert alert-danger" role="alert">{error}</div>}
{(message && message.trim() !== "" || error && error.trim() !== "") && <hr />}
{
sections && sections.length > 0 &&
<ul>
sections?
sections.length > 0 &&
<ul>
{
sections.map(section => <li key={section.key} role={`section-${section.key}`} className="section">
<div className="with-inline-cp">
Expand All @@ -311,7 +314,8 @@ export default function NFC() {
</div>
</div>
{
section.paths && section.paths.length > 0 && <ul>
section.paths?
section.paths.length > 0 && <ul>
{
section.paths.map(path =><li key={path}>
<div className="with-inline-cp">
Expand All @@ -325,14 +329,17 @@ export default function NFC() {
</div>
</li>)
}
</ul>
</ul>:
<div>No paths found for this NFC entry.</div>
}
</li>)
}
</ul>
</ul>:
<div>No NFC entries found</div>
}
{
!paginationHidden && <div className="pagination">
!paginationHidden && sections && sections.length > 0 &&
<div className="pagination">
<label>Page Size:</label>&nbsp;
<select value={page.current.size} onChange={e => {
changePageSize(e.target.value);
Expand Down

0 comments on commit 220fb7e

Please sign in to comment.