Skip to content
This repository was archived by the owner on Jan 29, 2026. It is now read-only.

Commit 4fbc7b9

Browse files
committed
fix: newMessageActive 조건 추가
1 parent e9ebe07 commit 4fbc7b9

File tree

1 file changed

+10
-6
lines changed
  • packages/tds-widget/src/chat/scroll-buttons-area

1 file changed

+10
-6
lines changed

packages/tds-widget/src/chat/scroll-buttons-area/index.tsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,15 @@ function ScrollButtonsAreaImpl<T = UserType>(
8585
// eslint-disable-next-line react-hooks/exhaustive-deps
8686
}, [lastSeenMessageId])
8787

88+
const isNewMessageActive = !currentBottomIntersecting.id
89+
? false
90+
: !(
91+
currentBottomIntersecting.isIntersecting ||
92+
!lastMessage ||
93+
!lastSeenMessageId ||
94+
Number(lastMessage.id) === Number(lastSeenMessageId)
95+
)
96+
8897
return (
8998
<Container>
9099
{mounted.current && lastMessage !== undefined && (
@@ -93,12 +102,7 @@ function ScrollButtonsAreaImpl<T = UserType>(
93102
onClick={onButtonClick}
94103
message={lastMessage}
95104
isBottomIntersecting={currentBottomIntersecting.isIntersecting}
96-
newMessageActive={
97-
!currentBottomIntersecting.isIntersecting &&
98-
lastMessage !== undefined &&
99-
lastSeenMessageId !== undefined &&
100-
Number(lastMessage.id) !== Number(lastSeenMessageId)
101-
}
105+
newMessageActive={isNewMessageActive}
102106
/>
103107
)}
104108
{children}

0 commit comments

Comments
 (0)