mirror of
https://github.com/Qortal/Qortal-Hub.git
synced 2025-04-23 19:37:52 +00:00
fix indicator new message
This commit is contained in:
parent
b3745e916c
commit
a499b25050
@ -34,14 +34,14 @@ export const MessageItem = ({
|
|||||||
}) => {
|
}) => {
|
||||||
const { ref, inView } = useInView({
|
const { ref, inView } = useInView({
|
||||||
threshold: 0.7, // Fully visible
|
threshold: 0.7, // Fully visible
|
||||||
triggerOnce: true, // Only trigger once when it becomes visible
|
triggerOnce: false, // Only trigger once when it becomes visible
|
||||||
});
|
});
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (inView && message.unread) {
|
if (inView && isLast && onSeen) {
|
||||||
onSeen(message.id);
|
onSeen(message.id);
|
||||||
}
|
}
|
||||||
}, [inView, message.id, message.unread, onSeen]);
|
}, [inView, message.id, isLast]);
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user