Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions src/libs/NetworkConnection.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@ import _ from 'underscore';
import Onyx from 'react-native-onyx';
import NetInfo from './NetInfo';
import ONYXKEYS from '../ONYXKEYS';
import SleepTimer from './SleepTimer';
import AppStateMonitor from './AppStateMonitor';
import promiseAllSettled from './promiseAllSettled';

// NetInfo.addEventListener() returns a function used to unsubscribe the
// listener so we must create a reference to it and call it in stopListeningForReconnect()
let unsubscribeFromNetInfo;
let unsubscribeFromSleepTimer;
let unsubscribeFromAppState;
let isOffline = false;
let logInfo = () => {};
Expand Down Expand Up @@ -63,14 +61,6 @@ function listenForReconnect() {
logInfo(`[NetworkConnection] NetInfo isConnected: ${state && state.isConnected}`);
setOfflineStatus(!state.isConnected);
});

// When a device is put to sleep, NetInfo is not always able to detect
// when connectivity has been lost. As a failsafe we will capture the time
// every two seconds and if the last time recorded goes past a threshold
// we know that the computer has been asleep.
unsubscribeFromSleepTimer = SleepTimer.addClockSkewListener(() => (
triggerReconnectionCallbacks('timer clock skewed')
));
}

/**
Expand All @@ -82,10 +72,6 @@ function stopListeningForReconnect() {
unsubscribeFromNetInfo();
unsubscribeFromNetInfo = undefined;
}
if (unsubscribeFromSleepTimer) {
unsubscribeFromSleepTimer();
unsubscribeFromSleepTimer = undefined;
}
if (unsubscribeFromAppState) {
unsubscribeFromAppState();
unsubscribeFromAppState = undefined;
Expand Down
37 changes: 0 additions & 37 deletions src/libs/SleepTimer/index.js

This file was deleted.

8 changes: 0 additions & 8 deletions src/libs/SleepTimer/index.native.js

This file was deleted.