Don't attempt to change globaldrawer properties if it's not loaded yet

This commit is contained in:
Bart De Vries 2021-12-17 11:11:17 +01:00
parent 91aa415908
commit 3aa45e555a
1 changed files with 8 additions and 6 deletions

View File

@ -40,12 +40,14 @@ Kirigami.ApplicationWindow {
}
function changeNavigation(isNarrow) {
if (isNarrow) {
globalDrawer.collapsed = true
globalDrawer.width = Layout.implicitWidth
} else {
globalDrawer.collapsed = false
globalDrawer.width = originalWidth
if (globalDrawer) {
if (isNarrow) {
globalDrawer.collapsed = true
globalDrawer.width = Layout.implicitWidth
} else {
globalDrawer.collapsed = false
globalDrawer.width = originalWidth
}
}
}