diff --git a/public/app/features/explore/state/history.ts b/public/app/features/explore/state/history.ts index e0fe9e9ee19..84447f65b41 100644 --- a/public/app/features/explore/state/history.ts +++ b/public/app/features/explore/state/history.ts @@ -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, }) );