Skip to content

Commit 3a1946b

Browse files
author
nicosammito
committed
feat: enhance step calculation in DFlowValueSuggestions hook to prevent infinite loops
1 parent 43607bd commit 3a1946b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/components/d-flow-suggestion/DFlowValueSuggestions.hook.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export const useValueSuggestions = (dataTypeIdentifier?: DataTypeIdentifier): DF
3838
if (config.from === null || config.from === undefined) return
3939
if (config.to === null || config.to === undefined) return
4040

41-
for (let i = config.from; i <= config.to; i += (config.steps ?? 1)) {
41+
for (let i = config.from; i <= config.to; i += ((config.steps ?? 1) <= 0 ? 1 : (config.steps ?? 1))) {
4242
suggestions.push({
4343
path: [],
4444
type: DFlowSuggestionType.VALUE,

0 commit comments

Comments
 (0)