Auth bug fix
[ubi] / qml / ubi / FilesPage.qml
index 8af530b..5a55fa8 100644 (file)
@@ -55,6 +55,8 @@ Page {
     function onErr(status)
     {
         mask.state = "idle";
+        initPage.hide();
+
         if(status==401) {
             tip.show(qsTr("Ubuntu One authorization has failed. Try once again or check login settings."));
         } else if(status==0) {
@@ -62,8 +64,14 @@ Page {
         } else {
             tip.show(qsTr("Unknown error: ")+status);
         }
-        pageStack.pop();
-        initPage.hide()
+
+        console.log("index="+pageStack.index);
+
+        if(pageStack.index>0) {
+            pageStack.pop();
+        } else {
+            pageStack.initialPage = "LoginPage.qml";
+        }
     }