Skip to content
This repository has been archived by the owner on Dec 12, 2018. It is now read-only.

Commit

Permalink
- Fixing login problem: Code could not be entered if login process wa…
Browse files Browse the repository at this point in the history
…s interrupted by app restart

- Adding contacts to content hub, trying to send vcards
  • Loading branch information
Flohack74 committed Aug 31, 2017
1 parent 15b1048 commit 5f2247a
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 32 deletions.
3 changes: 2 additions & 1 deletion telegram/app/content-hub.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"pictures",
"videos",
"links",
"text"
"text",
"contacts"
]
}
63 changes: 32 additions & 31 deletions telegram/app/qml/telegram.qml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ MainView {
signal pushRegister(string token, string version)
signal pushUnregister(string token)
signal resumed()

onActiveFocusChanged: {
if (activeFocus) {
mainView.resumed()
Expand Down Expand Up @@ -233,6 +233,15 @@ MainView {
pushClient.clearPersistent([]);
}
}

onAuthPasswordNeeded: {
pageStack.setPrimaryPage();
pageStack.addPageToCurrentColumn(pageStack.primaryPage, authPasswordPage);
}

Component.onCompleted: {
account_list.codeRequested.connect(pageStack.pushAuthCodePage)
}
}

AdaptivePageLayout {
Expand Down Expand Up @@ -275,6 +284,27 @@ MainView {
pageStack.removePages(pageStack.primaryPage);
}

function pushAuthCodePage(authCodePage, telegram, phoneRegistered, sendCallTimeout, resent) {
console.log("Number of profiles: " + profiles.count);

if (profiles.count === 1) {
pageStack.setPrimaryPage();
pageStack.addPageToCurrentColumn(pageStack.primaryPage, authCodePage, {
"phoneRegistered": telegram.authPhoneRegistered,
"timeOut": sendCallTimeout
});
}

// Only add the authCodePage if the code has not been resent. If the code has
// been resent then authCodePage is already on the stack
else if (!resent){
pageStack.addPageToCurrentColumn(auth_number_page, authCodePage, {
"phoneRegistered": telegram.authPhoneRegistered,
"timeOut": sendCallTimeout
});
}
}

IntroPage {
id: introPage
onStartMessaging: {
Expand Down Expand Up @@ -315,36 +345,7 @@ MainView {

Connections {
target: account_list
onCodeRequested: {
auth_number_page.isBusy = false;
console.log("Number of profiles: " + profiles.count);

if (profiles.count === 1) {
pageStack.setPrimaryPage();
pageStack.addPageToCurrentColumn(pageStack.primaryPage, authCodePage, {
"phoneRegistered": telegram.authPhoneRegistered,
"timeOut": sendCallTimeout
});
}

// Only add the authCodePage if the code has not been resent. If the code has
// been resent then authCodePage is already on the stack
else if (!resent){
pageStack.addPageToCurrentColumn(auth_number_page, authCodePage, {
"phoneRegistered": telegram.authPhoneRegistered,
"timeOut": sendCallTimeout
});
}

// else {
// authCodePage.timeOut = sendCallTimeout;
// authCodePage.phoneRegistered = telegram.authPhoneRegistered
// }
}
onAuthPasswordNeeded: {
pageStack.setPrimaryPage();
pageStack.addPageToCurrentColumn(pageStack.primaryPage, authPasswordPage);
}
onCodeRequested: auth_number_page.isBusy = false
}
}
}
Expand Down

0 comments on commit 5f2247a

Please sign in to comment.