-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Typing Feature #6
base: main
Are you sure you want to change the base?
Conversation
@types/enums.ts
Outdated
|
||
typing = 'typing', | ||
|
||
notTyping = 'notTyping', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
notTyping = 'notTyping', | |
stoppedTyping= 'stoppedTyping', |
client/chat/ChatInterface.tsx
Outdated
|
||
return () => { | ||
socket.off(IOEvents.newMessage, newMessageHandler); | ||
socket.off(IOEvents.joinedRoom, leftRoomHandler); | ||
socket.off(IOEvents.leftRoom, joinedRoomHandler); | ||
socket.off(IOEvents.typing, typingStartedHandler); | ||
socket.off(IOEvents.notTyping, typingStoppedHandler) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please keep consistent formatting. You can install prettier extension in your IDE to help with this
@e1vjss We need to add an input handler to the text box on the client. |
The |
|
||
let typingTimer: NodeJS.Timeout | null = null; | ||
|
||
const typingStartedHandler = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The formatting is way off, can you please keep it consistent. You can use a plugin called prettier to format
if (value.trim() !== "") { | ||
typingStartedHandler(); | ||
} else { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weird extra spacing here
@@ -9,6 +9,27 @@ function ChatInterface() { | |||
const [textMessage, setTextMessage] = useState(""); | |||
const [messages, setMessages] = useState<any[]>([]); | |||
const [notification, setNotification] = useState<string | null>(null); | |||
const [isTyping, setIsTyping] = useState(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we using the isTyping
to render a UI component?
I attempted to make some changes to prepare the server side for the typing feature. Im having a hard time understanding why we have two of each chatRoomController.ts and .js and same for the ChatRoom.js/ts and maybe some insight on what part of the docs I should look at. Thanks