feat(GODT-2767): pass user and username to setup wizard.

This commit is contained in:
Xavier Michelon
2023-08-10 09:31:57 +02:00
parent 9ef7d133c0
commit ad31e6a9c5
3 changed files with 18 additions and 15 deletions

View File

@ -27,12 +27,11 @@ Item {
Generic
}
property string address
property int client
property string clientVersion
property ColorScheme colorScheme
property string userID
property bool wasSignedOut
property var user
property string address
function clientIconSource() {
switch (client) {
@ -84,19 +83,19 @@ Item {
rightContent.currentIndex = 0;
}
function startClientConfig() {
function startClientConfig(user, address) {
root.user = user
root.address = address
root.visible = true;
rootStackLayout.currentIndex = 0;
leftContent.showClientSelector();
rightContent.currentIndex = 2;
}
function startLogin(wasSignedOut = false) {
function startLogin() {
root.visible = true;
rootStackLayout.currentIndex = 0;
root.userID = "";
root.address = "";
root.wasSignedOut = wasSignedOut;
leftContent.showLogin();
rightContent.currentIndex = 1;
login.reset(true);
@ -116,8 +115,14 @@ Item {
}
Connections {
function onLoginFinished() {
startClientConfig();
function onLoginFinished(userIndex, wasSignedOut) {
if (wasSignedOut) {
closeWizard();
return;
}
let user = Backend.users.get(userIndex)
let address = user ? user.addresses[0] : ""
startClientConfig(user, address);
}
target: Backend