fix: improve slash command conditional (#10102)
This commit is contained in:
parent
b703ceb69f
commit
36629df853
|
|
@ -1,14 +1,19 @@
|
|||
import { isString } from "lodash";
|
||||
import { isDynamicValue } from "utils/DynamicBindingUtils";
|
||||
|
||||
export const showBindingPrompt = (
|
||||
showEvaluatedValue: boolean,
|
||||
inputValue: any,
|
||||
isHinterOpen: boolean,
|
||||
): boolean => {
|
||||
const isDynamicInputValue = inputValue && isDynamicValue(inputValue);
|
||||
const lastCharacterOfSlash =
|
||||
inputValue && isString(inputValue) && inputValue.slice(-1);
|
||||
|
||||
return (
|
||||
showEvaluatedValue &&
|
||||
(!isString(inputValue) ||
|
||||
(!inputValue && !isHinterOpen) ||
|
||||
(!inputValue?.includes("{{") && !inputValue?.includes("/")))
|
||||
(!isDynamicInputValue && lastCharacterOfSlash !== "/"))
|
||||
);
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user