Set status to offline when closing app
This commit is contained in:
parent
4befdbd741
commit
34b73a70a7
@ -137,6 +137,18 @@ const Main: FC<StateProps & DispatchProps> = ({
|
|||||||
updateIsOnline(true);
|
updateIsOnline(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
function handleUnload() {
|
||||||
|
updateIsOnline(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
window.addEventListener('beforeunload', handleUnload);
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
window.removeEventListener('beforeunload', handleUnload);
|
||||||
|
};
|
||||||
|
}, [updateIsOnline]);
|
||||||
|
|
||||||
// Browser tab indicators
|
// Browser tab indicators
|
||||||
useBackgroundMode(() => {
|
useBackgroundMode(() => {
|
||||||
const initialUnread = selectCountNotMutedUnread(getGlobal());
|
const initialUnread = selectCountNotMutedUnread(getGlobal());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user