native: fix logout button
This commit is contained in:
parent
dabf39fa9a
commit
0b76f3472d
2 changed files with 8 additions and 7 deletions
|
@ -42,6 +42,9 @@ Window {
|
|||
id: mainPageComponent
|
||||
MainPage {
|
||||
authToken: authToken
|
||||
onLogout: {
|
||||
stackView.push(loginPageComponent)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue