dead code
This commit is contained in:
parent
ddd3201720
commit
67bf34b334
2 changed files with 6 additions and 6 deletions
|
|
@ -10,14 +10,12 @@ interface SlashCommandUIProps {
|
|||
assistant: AssistantConfig;
|
||||
filter: string;
|
||||
selectedIndex: number;
|
||||
onSelect: (command: string) => void;
|
||||
}
|
||||
|
||||
const SlashCommandUI: React.FC<SlashCommandUIProps> = ({
|
||||
assistant,
|
||||
filter,
|
||||
selectedIndex,
|
||||
onSelect,
|
||||
}) => {
|
||||
const [allCommands, setAllCommands] = useState<SlashCommand[]>([]);
|
||||
|
||||
|
|
|
|||
|
|
@ -91,12 +91,15 @@ const UserInput: React.FC<UserInputProps> = ({
|
|||
// Only show slash commands if slash is the very first character
|
||||
if (text.trimStart().startsWith("/")) {
|
||||
const trimmedText = text.trimStart();
|
||||
const beforeCursor = trimmedText.slice(0, cursor - (text.length - trimmedText.length));
|
||||
|
||||
const beforeCursor = trimmedText.slice(
|
||||
0,
|
||||
cursor - (text.length - trimmedText.length)
|
||||
);
|
||||
|
||||
// Only show if cursor is after the slash and before any whitespace
|
||||
if (beforeCursor.length > 0 && beforeCursor.startsWith("/")) {
|
||||
const afterSlash = beforeCursor.slice(1);
|
||||
|
||||
|
||||
if (!afterSlash.includes(" ") && !afterSlash.includes("\n")) {
|
||||
// We're in a slash command context
|
||||
setShowSlashCommands(true);
|
||||
|
|
@ -488,7 +491,6 @@ const UserInput: React.FC<UserInputProps> = ({
|
|||
assistant={assistant}
|
||||
filter={slashCommandFilter}
|
||||
selectedIndex={selectedCommandIndex}
|
||||
onSelect={selectSlashCommand}
|
||||
/>
|
||||
)}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue