mattjackson220 commented on a change in pull request #5490:
URL: https://github.com/apache/trafficcontrol/pull/5490#discussion_r570396658
##########
File path:
traffic_portal/app/src/common/modules/table/servers/TableServersController.js
##########
@@ -414,6 +414,16 @@ var TableServersController = function(tableName, servers,
filter, $scope, $state
} catch (e) {
console.error("Failure to load stored page
size:", e);
}
+
+ try {
+ const page = localStorage.getItem(tableName +
"_table_page");
+ const pageSize =
$scope.gridOptions.api.paginationGetPageSize();
+ if (page !== undefined && page > 0 && page <=
pageSize-1) {
+
$scope.gridOptions.api.paginationGoToPage(page);
+ }
+ } catch (e) {
+ console.error("failed to load stored page
number:", e);
Review comment:
only cause i had another change, can you capitalize "failed" for
consistency?
##########
File path:
traffic_portal/app/src/common/modules/table/servers/TableServersController.js
##########
@@ -414,6 +414,16 @@ var TableServersController = function(tableName, servers,
filter, $scope, $state
} catch (e) {
console.error("Failure to load stored page
size:", e);
}
+
+ try {
+ const page = localStorage.getItem(tableName +
"_table_page");
+ const pageSize =
$scope.gridOptions.api.paginationGetPageSize();
+ if (page !== undefined && page > 0 && page <=
pageSize-1) {
Review comment:
i think the `page <= pageSize-1` part is breaking it if the pageSize is
too low. I set pageSize to 2 rows and then went to page 5 which means it wont
go to that page again since it fails that part. maybe use
`$scope.gridOptions.api.paginationGetTotalPages()` instead?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]