Skip to content

Commit

Permalink
Should use sync timeout if possible
Browse files Browse the repository at this point in the history
  • Loading branch information
compulim committed Sep 22, 2019
1 parent 88052d5 commit 0ae4111
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/component/src/SendBox/ConnectivityStatus.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const DebouncedConnectivityStatus = ({ interval, children: propsChildren }) => {

useEffect(() => {
if (children !== propsChildren) {
const timeout = setTimeout(() => {
const timeout = setTimeoutSync(() => {
setChildren(() => propsChildren);
setSince(Date.now());
}, intervalBeforeSwitch);
Expand Down Expand Up @@ -150,8 +150,6 @@ const ConnectivityStatus = ({ connectivityStatus, language, styleSet }) => {
renderUninitialized
]);

console.log('render');

return (
<div aria-atomic="false" aria-live="polite" role="status">
<DebouncedConnectivityStatus
Expand Down

0 comments on commit 0ae4111

Please sign in to comment.