Skip to content

Commit

Permalink
storage: Fix border calculations for page tables
Browse files Browse the repository at this point in the history
Whether or not a page is the last one was wrong. The test needs to use
the sorted array, of course.
  • Loading branch information
mvollmer committed Jan 16, 2024
1 parent afc51b6 commit e2f3e9e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions pkg/storaged/pages.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -641,8 +641,9 @@ export const PageTable = ({ emptyCaption, aria_label, pages, crossrefs, sorted,
}

function make_page_rows(pages, level, last_has_border, key, sorted) {
for (const p of sort(pages, p => p, sorted)) {
const is_last = (level == 0 || p == pages[pages.length - 1]);
const sorted_pages = sort(pages, p => p, sorted);
for (const p of sorted_pages) {
const is_last = (level == 0 || p == sorted_pages[pages.length - 1]);
const p_key = key + ":" + (p.key || p.name);
make_row(p, null, level, is_last && p.children.length == 0 && last_has_border, p_key);
make_page_rows(p.children, level + 1, is_last && last_has_border, p_key, p.options.sorted);
Expand Down

0 comments on commit e2f3e9e

Please sign in to comment.