Skip to content

Commit

Permalink
Call loadNextPage function only when it is required while loading the…
Browse files Browse the repository at this point in the history
… table.

Resolved delete object(shortcut key) affecting both text and Object Explorer items.pgadmin-org#7683
  • Loading branch information
khushboovashi authored and RohitBhati8269 committed Jul 22, 2024
1 parent 9cbb9a3 commit d45a630
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions web/pgadmin/browser/static/js/keyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,7 @@ _.extend(pgBrowser.keyboardNavigation, {
},
bindSubMenuDelete: function() {
const tree = this.getTreeDetails();

if (!tree.d || pgAdmin.Browser.Nodes[tree.t.itemData(tree.i)._type].collection_node === true)
if (!tree.d || pgAdmin.Browser.Nodes[tree.t.itemData(tree.i)._type].collection_node === true || document.activeElement.className !== 'file-tree')
return;

// Call delete object callback
Expand Down
2 changes: 1 addition & 1 deletion web/pgadmin/static/js/components/PgTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export function Table({ columns, data, hasSelectRow, schema, sortOptions, tableP
useInfiniteQuery({
queryKey: ['logs'],
queryFn: async () => {
const fetchedData = await loadNextPage();
const fetchedData = loadNextPage ? await loadNextPage() : [];
return fetchedData;
},
initialPageParam: 0,
Expand Down

0 comments on commit d45a630

Please sign in to comment.