Skip to content

Commit

Permalink
linting check
Browse files Browse the repository at this point in the history
  • Loading branch information
Akshun-01 committed Mar 12, 2024
1 parent 5b81be2 commit c99bca0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
6 changes: 3 additions & 3 deletions packages/react/src/components/ChatInput/ChatInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ const ChatInput = ({ scrollToBottom }) => {
mentionIndex - 1 < 0 ? filteredMembers.length + 1 : mentionIndex - 1
);
setCommandIndex(
commandIndex - 1 < 0 ? filteredCommands.length - 1 : commandIndex - 1
commandIndex - 1 < 0 ? filteredCommands.length - 1 : commandIndex - 1
);

const lastIndexOfAt = messageRef.current.value.lastIndexOf('@');
Expand All @@ -486,12 +486,12 @@ const ChatInput = ({ scrollToBottom }) => {
setStartReading(false);
setFilteredMembers([]);
setmentionIndex(-1);
} else if(filteredCommands.length > 0){
} else if (filteredCommands.length > 0) {
const selectedCommand = filteredCommands[commandIndex];
onCommandClick(selectedCommand);

setCommandIndex(0);
}else {
} else {
sendTypingStop();
sendMessage();
}
Expand Down
8 changes: 5 additions & 3 deletions packages/react/src/components/CommandList/CommandsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,14 @@ function CommandsList({
if (commandRef.current) {
const selectedCommand = commandRef.current.children[commandIndex];
if (selectedCommand) {
selectedCommand.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
selectedCommand.scrollIntoView({
behavior: 'smooth',
block: 'nearest',
});
}
}
}, [commandIndex]);


return (
<Box
css={listStyle}
Expand All @@ -103,7 +105,7 @@ function CommandsList({
{filteredCommands.map((command, index) => (
<li
key={command.command}
role='presentation'
role="presentation"
css={listItemStyle}
onClick={() => handleCommandClick(command)}
onKeyDown={(e) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/Mentions/MembersList.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function MembersList({ mentionIndex, filteredMembers = [], onMemberClick }) {
font-weight: 600;
`;

const memberRef = useRef(null);
const memberRef = useRef(null);

const handleMemberClick = useCallback(
(selectedItem) => {
Expand Down

0 comments on commit c99bca0

Please sign in to comment.