Skip to content

Commit 1f821e5

Browse files
committed
fix the order of commands stored in workbenchStorage.ts
1 parent 38f85ad commit 1f821e5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

redisinsight/ui/src/services/workbenchStorage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ async function cleanupDatabaseHistory(dbId: string) {
315315
const commandsHistory: CommandHistoryType = await getLocalWbHistory(dbId)
316316
let size = 0
317317
// collect items up to maxItemsPerDb
318-
const update = commandsHistory.reduce((acc, commandsHistoryElement) => {
318+
const update = commandsHistory.reverse().reduce((acc, commandsHistoryElement) => {
319319
if (size >= WORKBENCH_HISTORY_MAX_LENGTH) {
320320
return acc
321321
}

0 commit comments

Comments
 (0)