Skip to content

Conversation

@jessevz
Copy link
Contributor

@jessevz jessevz commented Oct 13, 2025

…ont trigger reload twice

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes data reloading issues by restoring table settings from local storage during reload and prevents duplicate reload operations.

  • Modified the reload behavior to restore pagination and table state from local storage instead of resetting
  • Prevented text filter changes from triggering additional reload events during the reload process
  • Added empty lines for code formatting consistency

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
hashlists.datasource.ts Added empty line for formatting
ht-table.component.ts Updated reload method to restore table settings from local storage and prevent duplicate events
hashlists-table.component.ts Added empty line for formatting

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

this.bulkMenu.reload();
}
this.filterQueryFormGroup.get('textFilter').setValue('');
this.filterQueryFormGroup.get('textFilter').setValue('', { emitEvent: false});
Copy link

Copilot AI Oct 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space before closing brace in object literal.

Suggested change
this.filterQueryFormGroup.get('textFilter').setValue('', { emitEvent: false});
this.filterQueryFormGroup.get('textFilter').setValue('', { emitEvent: false });

Copilot uses AI. Check for mistakes.
Comment on lines +559 to +564
const tableSettings = this.uiSettings['uiConfig']['tableSettings'][this.name];
this.dataSource.pageSize = tableSettings['page'];
this.dataSource.pageAfter = tableSettings['start'];
this.dataSource.pageBefore = tableSettings['before'];
this.dataSource.index = tableSettings['index'];
this.dataSource.totalItems = tableSettings['totalItems'];
Copy link

Copilot AI Oct 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing null/undefined checks for tableSettings and its properties could cause runtime errors if the settings don't exist in localStorage.

Suggested change
const tableSettings = this.uiSettings['uiConfig']['tableSettings'][this.name];
this.dataSource.pageSize = tableSettings['page'];
this.dataSource.pageAfter = tableSettings['start'];
this.dataSource.pageBefore = tableSettings['before'];
this.dataSource.index = tableSettings['index'];
this.dataSource.totalItems = tableSettings['totalItems'];
const tableSettings = this.uiSettings &&
this.uiSettings['uiConfig'] &&
this.uiSettings['uiConfig']['tableSettings'] &&
this.uiSettings['uiConfig']['tableSettings'][this.name]
? this.uiSettings['uiConfig']['tableSettings'][this.name]
: {};
this.dataSource.pageSize = tableSettings['page'] !== undefined ? tableSettings['page'] : this.dataSource.pageSize;
this.dataSource.pageAfter = tableSettings['start'] !== undefined ? tableSettings['start'] : this.dataSource.pageAfter;
this.dataSource.pageBefore = tableSettings['before'] !== undefined ? tableSettings['before'] : this.dataSource.pageBefore;
this.dataSource.index = tableSettings['index'] !== undefined ? tableSettings['index'] : this.dataSource.index;
this.dataSource.totalItems = tableSettings['totalItems'] !== undefined ? tableSettings['totalItems'] : this.dataSource.totalItems;

Copilot uses AI. Check for mistakes.
@gluafamichl gluafamichl merged commit fec9386 into dev Oct 14, 2025
2 of 3 checks passed
@gluafamichl gluafamichl deleted the fix-reload branch October 14, 2025 06:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants