diff --git a/src/libs/ActiveClientManager/index.js b/src/libs/ActiveClientManager/index.js index 661cc38fb777..7f0d4bf0cd91 100644 --- a/src/libs/ActiveClientManager/index.js +++ b/src/libs/ActiveClientManager/index.js @@ -3,22 +3,22 @@ import Onyx from 'react-native-onyx'; import Str from 'expensify-common/lib/str'; import ONYXKEYS from '../../ONYXKEYS'; import * as ActiveClients from '../actions/ActiveClients'; -import createOnReadyTask from '../createOnReadyTask'; const clientID = Str.guid(); const maxClients = 20; let activeClients; -// Keeps track of the ActiveClientManager's readiness in one place -// so that multiple calls of isReady resolve the same promise -const activeClientsReadyTask = createOnReadyTask(); +let resolveIsReadyPromise; +const isReadyPromise = new Promise((resolve) => { + resolveIsReadyPromise = resolve; +}); /** * @returns {Promise} */ function isReady() { - return activeClientsReadyTask.isReady(); + return isReadyPromise; } Onyx.connect({ @@ -37,7 +37,7 @@ Onyx.connect({ */ function init() { ActiveClients.addClient(clientID) - .then(activeClientsReadyTask.setIsReady); + .then(resolveIsReadyPromise); } /**