Hook up prefetcher settings

Summary: This makes use of the previously set up new settings. The logic is a tiny bit difficult to follow so I wanted to make sure it's not lost in the noise of the previous diff.

Reviewed By: jknoxville

Differential Revision: D18036538

fbshipit-source-id: db3bbce4361862cee479aed70578a4bcbde2c46d
This commit is contained in:
Pascal Hartig
2019-10-22 08:08:26 -07:00
committed by Facebook Github Bot
parent 82a253cf28
commit a77064ad84
2 changed files with 9 additions and 6 deletions

View File

@@ -77,7 +77,8 @@ const AppFrame = () => {
};
function setProcessState(store: Store) {
const androidHome = store.getState().settingsState.androidHome;
const settings = store.getState().settingsState;
const androidHome = settings.androidHome;
if (!process.env.ANDROID_HOME) {
process.env.ANDROID_HOME = androidHome;
@@ -89,6 +90,10 @@ function setProcessState(store: Store) {
['emulator', 'tools', 'platform-tools']
.map(directory => path.resolve(androidHome, directory))
.join(':') + `:${process.env.PATH}`;
window.requestIdleCallback(() => {
setupPrefetcher(settings);
});
}
function init() {
@@ -96,10 +101,6 @@ function init() {
initLauncherHooks(config(), store);
const sessionId = store.getState().application.sessionId;
initCrashReporter(sessionId || '');
window.requestIdleCallback(() => {
setupPrefetcher();
});
}
// rehydrate app state before exposing init