wait until whole app is loaded

This commit is contained in:
Bruce Hauman 2017-09-23 15:26:20 -04:00
parent 3ff63a6814
commit de04f0ba94

View File

@ -187,16 +187,16 @@ function assertRootElExists(platform) {
} }
function loadApp(platform, devHost, onLoadCb) { function loadApp(platform, devHost, onLoadCb) {
// serverHost = devHost;
var fileBasePath = serverBaseUrl((isChrome() ? "localhost" : devHost)) + "/" + config.basePath + platform; var fileBasePath = serverBaseUrl((isChrome() ? "localhost" : devHost)) + "/" + config.basePath + platform;
// callback when app is ready to get the reloadable component // callback when app is ready to get the reloadable component
var mainJs = '/env/' + platform + '/main.js'; var mainJs = '/figwheel/connect/build_' + platform + '.js';
evalListeners.push(function (url) { evalListeners.push(function (url) {
if (url.indexOf(mainJs) > -1) { if (url.indexOf(mainJs) > -1) {
assertRootElExists(platform); assertRootElExists(platform);
onLoadCb(env[platform].main.root_el); onLoadCb(env[platform].main.root_el);
console.info('Done loading Clojure app'); console.info('Done loading Clojure app');
// TODO remove listener
} }
}); });