Restructure omni services and add Chatwoot research snapshot
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
export class WindowVisibilityHelper {
|
||||
constructor() {
|
||||
this.isVisible = true;
|
||||
this.initializeEvent();
|
||||
}
|
||||
|
||||
initializeEvent = () => {
|
||||
window.addEventListener('blur', () => {
|
||||
this.isVisible = false;
|
||||
});
|
||||
window.addEventListener('focus', () => {
|
||||
this.isVisible = true;
|
||||
});
|
||||
};
|
||||
|
||||
isWindowVisible() {
|
||||
return !document.hidden && this.isVisible;
|
||||
}
|
||||
}
|
||||
|
||||
export default new WindowVisibilityHelper();
|
||||
Reference in New Issue
Block a user