setLastMessageDisplayedIndex() must be called outside of the useTypingEffect hook for it to render correctly.
Also, changed displayedDialogSegment to ALWAYS call useTypingEffect, otherwise the hooks calls differ and breaks.
wasAlreadyViewed check is moved inside useTypingEffect because of this.
setLastMessageDisplayedIndex() must be called outside of the useTypingEffect hook for it to render correctly. Also, changed displayedDialogSegment to ALWAYS call useTypingEffect, otherwise the hooks calls differ and breaks. wasAlreadyViewed check is moved inside useTypingEffect because of this.