SkirdaElectronLauncher/app/assets/js/scripts/uibinder.js
Daniel Scalzi cd4f7918c8
Pipe output from forked processes back to parent.
Also cleaned up the code a bit. Switched to use lambda declarations in promises and renamed 'fulfill' to 'resolve', as it should be,
2018-05-07 18:15:59 -04:00

43 lines
1.2 KiB
JavaScript

/**
* Initialize UI functions which depend on internal modules.
* Loaded after core UI functions are initialized in uicore.js.
*/
// Requirements
const path = require('path')
const ConfigManager = require('./assets/js/configmanager.js')
let rscShouldLoad = false
// Synchronous Listener
document.addEventListener('readystatechange', function(){
if (document.readyState === 'complete'){
if(rscShouldLoad){
if(ConfigManager.isFirstLaunch()){
$('#welcomeContainer').fadeIn(500)
} else {
$('#landingContainer').fadeIn(500)
}
}
}
/*if (document.readyState === 'interactive'){
}*/
}, false)
// Actions that must be performed after the distribution index is downloaded.
ipcRenderer.on('distributionIndexDone', (data) => {
updateSelectedServer(AssetGuard.getServerById(ConfigManager.getLauncherDirectory(), ConfigManager.getSelectedServer()).name)
refreshServerStatus()
if(document.readyState === 'complete'){
if(ConfigManager.isFirstLaunch()){
$('#welcomeContainer').fadeIn(500)
} else {
$('#landingContainer').fadeIn(500)
}
} else {
rscShouldLoad = true
}
})