Skip to content

Commit

Permalink
fixing row pew page
Browse files Browse the repository at this point in the history
  • Loading branch information
vwh committed Jul 23, 2024
1 parent f352b26 commit 2f6a66b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/components/table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ export function DBTable() {

const tableName = useMemo(
() => tables[parseInt(selectedTable)]?.name,
[tables, selectedTable],
[tables, selectedTable]
);
const rowCount = useMemo(
() => tables[parseInt(selectedTable)]?.count || 0,
[tables, selectedTable],
[tables, selectedTable]
);

// Reset query and page when table changes
Expand Down Expand Up @@ -69,7 +69,7 @@ export function DBTable() {
}
})();
}
}, [db, tableName, page]);
}, [db, tableName, page, rowPerPageOrAuto]);

const handleResetQuery = useCallback(() => {
setQueryError(null);
Expand Down Expand Up @@ -109,11 +109,12 @@ export function DBTable() {
if (rowPerPageOrAuto === "auto") {
let rowHeight = 110;
const screenHeight = window.innerHeight;
console.log(screenHeight);
if (screenHeight > 1500) rowHeight = 75;
else if (screenHeight > 1000) rowHeight = 90;
else if (screenHeight < 750) rowHeight = 150;
rowsPerPage = Math.max(1, Math.floor(screenHeight / rowHeight));
} else {
rowsPerPage = rowPerPageOrAuto;
}

return (
Expand Down

0 comments on commit 2f6a66b

Please sign in to comment.