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:
committed by
Facebook Github Bot
parent
82a253cf28
commit
a77064ad84
@@ -7,5 +7,7 @@
|
|||||||
* @format
|
* @format
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export default async function setupPrefetcher() {}
|
import {Settings} from '../reducers/settings';
|
||||||
|
|
||||||
|
export default async function setupPrefetcher(_settings: Settings) {}
|
||||||
export const shouldInstallPrefetcher = () => false;
|
export const shouldInstallPrefetcher = () => false;
|
||||||
|
|||||||
11
src/init.tsx
11
src/init.tsx
@@ -77,7 +77,8 @@ const AppFrame = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function setProcessState(store: Store) {
|
function setProcessState(store: Store) {
|
||||||
const androidHome = store.getState().settingsState.androidHome;
|
const settings = store.getState().settingsState;
|
||||||
|
const androidHome = settings.androidHome;
|
||||||
|
|
||||||
if (!process.env.ANDROID_HOME) {
|
if (!process.env.ANDROID_HOME) {
|
||||||
process.env.ANDROID_HOME = androidHome;
|
process.env.ANDROID_HOME = androidHome;
|
||||||
@@ -89,6 +90,10 @@ function setProcessState(store: Store) {
|
|||||||
['emulator', 'tools', 'platform-tools']
|
['emulator', 'tools', 'platform-tools']
|
||||||
.map(directory => path.resolve(androidHome, directory))
|
.map(directory => path.resolve(androidHome, directory))
|
||||||
.join(':') + `:${process.env.PATH}`;
|
.join(':') + `:${process.env.PATH}`;
|
||||||
|
|
||||||
|
window.requestIdleCallback(() => {
|
||||||
|
setupPrefetcher(settings);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
@@ -96,10 +101,6 @@ function init() {
|
|||||||
initLauncherHooks(config(), store);
|
initLauncherHooks(config(), store);
|
||||||
const sessionId = store.getState().application.sessionId;
|
const sessionId = store.getState().application.sessionId;
|
||||||
initCrashReporter(sessionId || '');
|
initCrashReporter(sessionId || '');
|
||||||
|
|
||||||
window.requestIdleCallback(() => {
|
|
||||||
setupPrefetcher();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// rehydrate app state before exposing init
|
// rehydrate app state before exposing init
|
||||||
|
|||||||
Reference in New Issue
Block a user