mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Update total items when query history item is deleted to avoid triggering pagination (#49899)
This commit is contained in:
@@ -60,9 +60,10 @@ const updateRichHistoryState = ({ updatedQuery, deletedId }: SyncHistoryUpdatesO
|
||||
.map((query) => (query.id === updatedQuery?.id ? updatedQuery : query))
|
||||
// or remove
|
||||
.filter((query) => query.id !== deletedId);
|
||||
const deletedItems = item.richHistory.length - newRichHistory.length;
|
||||
dispatch(
|
||||
richHistoryUpdatedAction({
|
||||
richHistoryResults: { richHistory: newRichHistory, total: item.richHistoryTotal },
|
||||
richHistoryResults: { richHistory: newRichHistory, total: item.richHistoryTotal! - deletedItems },
|
||||
exploreId,
|
||||
})
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user