Pull request: request disabled protection duration on tab change
Updates #5759 Squashed commit of the following: commit 970f88b142ba06eb328ed648f69e0547a5a46902 Merge: e2b624e4437b69b218Author: Ildar Kamalov <ik@adguard.com> Date: Tue Nov 14 10:30:47 2023 +0300 Merge branch 'master' into ADG-7199 commit e2b624e4473a9c42c60502dfa878abbc8393bdd6 Merge: ba79dedc6fdf60eeedAuthor: Ildar Kamalov <ik@adguard.com> Date: Mon Nov 13 13:08:10 2023 +0300 Merge branch 'master' into ADG-7199 commit ba79dedc6551f5025b88c94897dcc7e65a314779 Author: Ildar Kamalov <ik@adguard.com> Date: Mon Nov 13 10:56:36 2023 +0300 changelog commit a0c13fd1704198460c3c907beb17df77243a243b Author: Ildar Kamalov <ik@adguard.com> Date: Sun Nov 12 16:51:26 2023 +0300 ADG-7199 request disabled protection duration on tab change
This commit is contained in:
@@ -28,7 +28,7 @@ import {
|
||||
} from '../../helpers/constants';
|
||||
import { getLogsUrlParams, setHtmlLangAttr, setUITheme } from '../../helpers/helpers';
|
||||
import Header from '../Header';
|
||||
import { changeLanguage, getDnsStatus } from '../../actions';
|
||||
import { changeLanguage, getDnsStatus, getTimerStatus } from '../../actions';
|
||||
|
||||
import Dashboard from '../../containers/Dashboard';
|
||||
import SetupGuide from '../../containers/SetupGuide';
|
||||
@@ -126,6 +126,18 @@ const App = () => {
|
||||
|
||||
useEffect(() => {
|
||||
dispatch(getDnsStatus());
|
||||
|
||||
const handleVisibilityChange = () => {
|
||||
if (document.visibilityState === 'visible') {
|
||||
dispatch(getTimerStatus());
|
||||
}
|
||||
};
|
||||
|
||||
document.addEventListener('visibilitychange', handleVisibilityChange);
|
||||
|
||||
return () => {
|
||||
document.removeEventListener('visibilitychange', handleVisibilityChange);
|
||||
};
|
||||
}, []);
|
||||
|
||||
const setLanguage = () => {
|
||||
|
||||
Reference in New Issue
Block a user