native: fix logout button

This commit is contained in:
Johannes Jöns 2024-07-11 11:25:08 +02:00
parent dabf39fa9a
commit 0b76f3472d
2 changed files with 8 additions and 7 deletions

View file

@ -42,6 +42,9 @@ Window {
id: mainPageComponent
MainPage {
authToken: authToken
onLogout: {
stackView.push(loginPageComponent)
}
}
}
}

View file

@ -14,6 +14,8 @@ Rectangle {
property string authToken: ""
signal logout()
Rectangle {
id: s1
anchors {
@ -43,12 +45,10 @@ Rectangle {
rightMargin: 10
right: s1.right
}
text: qsTr("Login")
text: qsTr("Logout")
onClicked: {
var component = Qt.createComponent("LoginScreen.qml")
var window = component.createObject(root)
window.show()
logout();
}
}
}
@ -122,9 +122,7 @@ Rectangle {
}
text: qsTr("Login Screen")
onClicked: {
var component = Qt.createComponent("LoginScreen.qml")
var window = component.createObject(root)
window.show()
logout();
}
}
}