Skip to content

Commit 9e3e35f

Browse files
committed
πŸ› fix : 첫 λ‘œλ“œλ•Œ λ¬΄ν•œμŠ€ν¬λ‘€ 적용 μ•ˆλ˜λŠ” 였λ₯˜ μˆ˜μ •
1 parent 638c93c commit 9e3e35f

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

β€Žsrc/pages/Recipient/Recipient.jsxβ€Ž

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ export default function Recipient({ showDelete }) {
2020
const [hasNextMessage, setHasNextMessage] = useState(false);
2121
const [selectedCardId, setSelectedCardId] = useState(null);
2222
const observerRef = useRef();
23-
const hasInitialized = useRef(false);
2423
const navigate = useNavigate();
2524

2625
useEffect(() => {
@@ -83,10 +82,7 @@ export default function Recipient({ showDelete }) {
8382
useEffect(() => {
8483
const observer = new IntersectionObserver((entries) => {
8584
const firstEntry = entries[0];
86-
if (!hasInitialized.current) {
87-
hasInitialized.current = true;
88-
return; // 첫 싀행은 λ¬΄μ‹œ
89-
}
85+
9086
if (firstEntry.isIntersecting && hasNextMessage && !loading) {
9187
loadMoreMessages();
9288
}
@@ -101,7 +97,6 @@ export default function Recipient({ showDelete }) {
10197
if (loading || !hasNextMessage) return;
10298
setLoading(true);
10399
const limit = 6;
104-
console.log('load');
105100
setOffset((prev) => prev + limit);
106101
};
107102

0 commit comments

Comments
Β (0)