-
Notifications
You must be signed in to change notification settings - Fork 17
Fixed reloading by fetching data from locoal storage on reload, and d… #456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ont trigger reload twice
There was a problem hiding this 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}); |
Copilot
AI
Oct 13, 2025
There was a problem hiding this comment.
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.
| this.filterQueryFormGroup.get('textFilter').setValue('', { emitEvent: false}); | |
| this.filterQueryFormGroup.get('textFilter').setValue('', { emitEvent: false }); |
| 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']; |
Copilot
AI
Oct 13, 2025
There was a problem hiding this comment.
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.
| 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; |
…ont trigger reload twice