Skip to content

Commit c3228d7

Browse files
Raubzeugtsufiev
authored andcommitted
fix: should set correct initial current index in queries history
1 parent d214eee commit c3228d7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/store/reducers/executeQuery.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ const initialState = {
3434
input: '',
3535
history: {
3636
queries: queriesHistoryInitial.slice(sliceLimit < 0 ? 0 : sliceLimit),
37-
currentIndex: -1,
37+
currentIndex:
38+
queriesHistoryInitial.length > MAXIMUM_QUERIES_IN_HISTORY
39+
? MAXIMUM_QUERIES_IN_HISTORY - 1
40+
: queriesHistoryInitial.length - 1,
3841
},
3942
runAction: RUN_ACTIONS_VALUES.script,
4043
monacoHotKey: null,

0 commit comments

Comments
 (0)