Skip to content

Commit

Permalink
Merge pull request #41 from chtrembl/fix
Browse files Browse the repository at this point in the history
updated DPChat to check for connected status before attempting to sen…
  • Loading branch information
chtrembl authored Feb 1, 2024
2 parents 0f0f404 + e93076a commit ba5a967
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,11 @@ function DPChat({

useEffect(() => {
// send init event, since we will finish loading before we display the DP
setTimeout(() => {
dispatch(sendTextMessage({ text: '...' }));
}, 5000);
if (connected) {
setTimeout(() => {
dispatch(sendTextMessage({ text: '...' }));
}, 2500);
}
// run resize once on mount, then add listener for future resize events
handleResize();
window.addEventListener('resize', handleResize);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,11 @@ function Loading({
};
const history = useHistory();
useEffect(() => {
if (skip === true && connected === true) history.push('/video');
if (skip === true && connected === true) {
setTimeout(() => {
history.push('/video');
}, 2500);
}
}, [connected, skip]);

return (
Expand Down

0 comments on commit ba5a967

Please sign in to comment.