Files
status-app/ui/app/mainui/sectionLoaders/AppMainLoader.qml
T
Jonathan Rainville 4174a54e2e feat(splash): show AppMain as soon as we login and guard against crashes
Part of #21462

Introduces a separate shell-ready signal so password login can transition from onboarding to `AppMain` before the main module finishes loading. It tracks full initialization through `mainReady`, defers several module-dependent stores and services, adds null-safe bindings and placeholder data, and only marks the application fully ready once `mainLoaded` is received.
2026-08-05 12:31:16 -04:00

49 lines
1.4 KiB
QML

import QtQml
import QtQuick
import StatusQ
import shared.stores as SharedStores
import AppLayouts.stores as AppStores
import AppLayouts.Profile.stores as ProfileStores
Loader {
id: root
required property AppStores.FeatureFlagsStore featureFlagsStore
required property ProfileStores.LanguageStore languageStore
required property Keychain keychain
required property bool systemTrayIconAvailable
property SharedStores.UtilsStore utilsStore
property bool mainReady: false
function loadSection() {
if (!root.active)
return
if (root.source === QmlCompiler.appMainUrl)
return
setSource(QmlCompiler.appMainUrl, {
objectName: "appMain",
featureFlagsStore: Qt.binding(() => root.featureFlagsStore),
languageStore: Qt.binding(() => root.languageStore),
keychain: Qt.binding(() => root.keychain),
utilsStore: Qt.binding(() => root.utilsStore),
systemTrayIconAvailable:Qt.binding(() => root.systemTrayIconAvailable),
mainReady: Qt.binding(() => root.mainReady),
})
}
onActiveChanged: {
if (root.active) {
loadSection()
return
}
}
onMainReadyChanged: loadSection()
Component.onCompleted: QmlCompiler.precompile(QmlCompiler.appMainUrl, false)
}