Skip to content

Commit

Permalink
Update WatchLiveStream.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinh-Tan-Dat authored Dec 6, 2024
1 parent 62429d9 commit 6500cf8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/pages/WatchLiveStream.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ const WatchLiveStream = () => {

useEffect(() => {
checkStreamStatus(); // Kiểm tra trạng thái khi tải trang
fetchChatMessages(); // Lấy tin nhắn khi tải trang
const interval = setInterval(() => {
fetchChatMessages();
}, 2000); // Fetch mỗi 5 giây

return () => clearInterval(interval); // Dọn dẹp khi component bị hủy
}, [streamUrl]);
const username = localStorage.getItem("userName");
// Xử lý gửi tin nhắn
Expand Down

0 comments on commit 6500cf8

Please sign in to comment.