diff options
-rw-r--r-- | views/accounts/qml/View.qml | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/views/accounts/qml/View.qml b/views/accounts/qml/View.qml index 5fe307a2..84ba2ef1 100644 --- a/views/accounts/qml/View.qml +++ b/views/accounts/qml/View.qml | |||
@@ -70,6 +70,11 @@ FocusScope { | |||
70 | 70 | ||
71 | model: Kube.AccountsModel {} | 71 | model: Kube.AccountsModel {} |
72 | 72 | ||
73 | onCountChanged: { | ||
74 | if (count == 0) { | ||
75 | edit.accountId = "" | ||
76 | } | ||
77 | } | ||
73 | onCurrentItemChanged: { | 78 | onCurrentItemChanged: { |
74 | if (currentItem) { | 79 | if (currentItem) { |
75 | edit.accountId = currentItem.currentData.accountId | 80 | edit.accountId = currentItem.currentData.accountId |
@@ -109,6 +114,13 @@ FocusScope { | |||
109 | 114 | ||
110 | canRemove: !root.singleAccountMode | 115 | canRemove: !root.singleAccountMode |
111 | 116 | ||
117 | onAccountIdChanged: { | ||
118 | if (accountId == "") { | ||
119 | //Require the setup to be completed since it's the first account | ||
120 | accountWizardComponent.createObject(root, {requireSetup: true}).open() | ||
121 | } | ||
122 | } | ||
123 | |||
112 | Component.onCompleted: { | 124 | Component.onCompleted: { |
113 | //We don't have any accounts setup if accountId is empty, so we trigger the accountWizard | 125 | //We don't have any accounts setup if accountId is empty, so we trigger the accountWizard |
114 | //FIXME: this assumes we load accounts synchronously, which we do right now. | 126 | //FIXME: this assumes we load accounts synchronously, which we do right now. |