Skip to content

Commit 679d6e6

Browse files
author
Kristiyan Ivanov
authored
Merge pull request #4562 from RedisInsight/bugfix/fe/RI-7123-workbench-commands-order
RI-7123: fix the order of commands stored in workbenchStorage.ts
2 parents f2c2bdc + 1f821e5 commit 679d6e6

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)