Skip to content

Commit

Permalink
optimize code
Browse files Browse the repository at this point in the history
Signed-off-by: yubonluo <yubonluo@amazon.com>
  • Loading branch information
yubonluo committed Apr 15, 2024
1 parent a44deab commit 3c374f6
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -699,12 +699,12 @@ export class SavedObjectsTable extends Component<SavedObjectsTableProps, SavedOb
findOptions.perPage = MAX_OBJECTS_AMOUNT;
findOptions.sortField = 'updated_at';
findOptions.page = 1;
while (true) {

while (duplicateAllSavedObjects.length < this.state.filteredItemCount) {
try {
const resp = await findObjects(http, findOptions);
const savedObjects = resp.savedObjects;
duplicateAllSavedObjects = duplicateAllSavedObjects.concat(savedObjects);
if (resp.savedObjects.length < MAX_OBJECTS_AMOUNT) break;
} catch (error) {
notifications.toasts.addDanger({
title: i18n.translate(
Expand Down

0 comments on commit 3c374f6

Please sign in to comment.