mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-13 07:06:58 +00:00
feat: LoginScreen - ability to dismiss biometrics popup
This commit is contained in:
parent
d26991bc72
commit
54ff857f3d
@ -158,6 +158,7 @@ SplitView {
|
||||
isBiometricsLogin: localAccountSettings.storeToKeychainValue === Constants.keychain.storedValue.store
|
||||
|
||||
onBiometricsRequested: (profileId) => biometricsPopup.open()
|
||||
onDismissBiometricsRequested: biometricsPopup.close()
|
||||
|
||||
onFinished: (flow, data) => {
|
||||
console.warn("!!! ONBOARDING FINISHED; flow:", flow, "; data:", JSON.stringify(data))
|
||||
|
@ -42,6 +42,7 @@ SQUtils.QObject {
|
||||
required property var tryToSetPukFunction
|
||||
|
||||
signal biometricsRequested(string profileId)
|
||||
signal dismissBiometricsRequested
|
||||
signal loginRequested(string keyUid, int method, var data)
|
||||
signal keycardPinCreated(string pin)
|
||||
signal enableBiometricsRequested(bool enable)
|
||||
@ -153,6 +154,7 @@ SQUtils.QObject {
|
||||
isBiometricsLogin: root.isBiometricsLogin
|
||||
|
||||
onBiometricsRequested: (profileId) => root.biometricsRequested(profileId)
|
||||
onDismissBiometricsRequested: root.dismissBiometricsRequested()
|
||||
onLoginRequested: (keyUid, method, data) => root.loginRequested(keyUid, method, data)
|
||||
onOnboardingCreateProfileFlowRequested: root.stackView.push(createProfilePage)
|
||||
onOnboardingLoginFlowRequested: root.stackView.push(loginPage)
|
||||
@ -160,6 +162,13 @@ SQUtils.QObject {
|
||||
onUnblockWithSeedphraseRequested: unblockWithSeedphraseFlow.init()
|
||||
onUnblockWithPukRequested: unblockWithPukFlow.init()
|
||||
|
||||
onVisibleChanged: {
|
||||
if (!visible)
|
||||
root.dismissBiometricsRequested()
|
||||
}
|
||||
|
||||
Component.onDestruction: root.dismissBiometricsRequested()
|
||||
|
||||
Binding {
|
||||
target: d
|
||||
restoreMode: Binding.RestoreValue
|
||||
|
@ -33,6 +33,7 @@ Page {
|
||||
signal finished(int flow, var data)
|
||||
|
||||
signal biometricsRequested(string profileId)
|
||||
signal dismissBiometricsRequested
|
||||
|
||||
// -> "keyUid:string": User ID to login; "method:int": password or keycard (cf Onboarding.LoginMethod.*) enum;
|
||||
// "data:var": contains "password" or "pin"
|
||||
@ -183,6 +184,7 @@ Page {
|
||||
remainingPukAttempts: root.onboardingStore.keycardRemainingPukAttempts
|
||||
|
||||
onBiometricsRequested: (profileId) => root.biometricsRequested(profileId)
|
||||
onDismissBiometricsRequested: root.dismissBiometricsRequested()
|
||||
onLoginRequested: (keyUid, method, data) => root.loginRequested(keyUid, method, data)
|
||||
|
||||
onKeycardPinCreated: (pin) => {
|
||||
|
@ -34,6 +34,7 @@ OnboardingPage {
|
||||
readonly property bool selectedProfileIsKeycard: d.currentProfileIsKeycard
|
||||
|
||||
signal biometricsRequested(string profileId)
|
||||
signal dismissBiometricsRequested
|
||||
|
||||
function setBiometricResponse(secret: string, error = "",
|
||||
detailedError = "",
|
||||
@ -198,6 +199,8 @@ OnboardingPage {
|
||||
root.keycardState === Onboarding.KeycardState.BlockedPUK
|
||||
|
||||
onSelectedProfileKeyIdChanged: {
|
||||
root.dismissBiometricsRequested()
|
||||
|
||||
d.resetBiometricsResult()
|
||||
d.settings.lastKeyUid = selectedProfileKeyId
|
||||
|
||||
|
11
ui/main.qml
11
ui/main.qml
@ -420,7 +420,7 @@ StatusWindow {
|
||||
}
|
||||
|
||||
Keychain {
|
||||
service: Qt.application.name
|
||||
service: "StatusDesktop"
|
||||
|
||||
id: keychain
|
||||
}
|
||||
@ -445,7 +445,9 @@ StatusWindow {
|
||||
|
||||
anchors.fill: parent
|
||||
|
||||
isBiometricsLogin: false
|
||||
// FIXME, https://github.com/status-im/status-desktop/issues/17240
|
||||
isBiometricsLogin: Qt.platform.os === Constants.mac
|
||||
|
||||
networkChecksEnabled: true
|
||||
biometricsAvailable: Qt.platform.os === Constants.mac
|
||||
|
||||
@ -461,6 +463,11 @@ StatusWindow {
|
||||
keychain.requestGetCredential(reason, profileId)
|
||||
}
|
||||
|
||||
onDismissBiometricsRequested: {
|
||||
if (keychain.loading)
|
||||
keychain.cancelActiveRequest()
|
||||
}
|
||||
|
||||
onFinished: (flow, data) => {
|
||||
const error = onboardingStore.finishOnboardingFlow(flow, data)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user