[v9.0.x] Query History: Do not show "load more" button when query history item is deleted (#50097)

(cherry picked from commit 927b6e33c0)

Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
This commit is contained in:
Grot (@grafanabot)
2022-06-03 09:31:41 +02:00
committed by GitHub
co-authored by Piotr Jamróz
parent 8217167b03
commit 742abc8129
+2 -1
View File
@@ -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,
})
);