Slight refactoring of CoreUI init order

We must not fire the StartupComplete callback before we've signaled that
we are done loading the UI in the UiStateViewModel.
This commit is contained in:
Gina Häußge committed 2017-11-14 16:49:43 +01:00
1 parent 481faf8da1
commit 9554079e4b
1 file changed
+7 -6
+7 -6
View File
@@ -660,10 +660,6 @@ $(function() {
callViewModels(allViewModels, "onAllBound", [allViewModels]);
log.info("... binding done");
// startup complete
callViewModels(allViewModels, "onStartupComplete");
setOnViewModels(allViewModels, "_startupComplete", true);
// make sure we can track the browser tab visibility
OctoPrint.coreui.onBrowserVisibilityChange(function(status) {
log.debug("Browser tab is now " + (status ? "visible" : "hidden"));
@@ -674,12 +670,18 @@ $(function() {
changeTab();
});
if (window.location.hash != "")
if (window.location.hash !== "")
{
changeTab();
}
log.info("Application startup complete");
viewModelMap["uiStateViewModel"].loading(false);
// startup complete
callViewModels(allViewModels, "onStartupComplete");
setOnViewModels(allViewModels, "_startupComplete", true);
};
var fetchSettings = function() {
@@ -749,7 +751,6 @@ $(function() {
// This is to ensure that we have no concurrent requests triggered by socket events
// overriding each other's session during app initialization
dataUpdater.initialized();
viewModelMap["uiStateViewModel"].loading(false);
});
};