diff --git a/storybook/pages/ChangePasswordViewPage.qml b/storybook/pages/ChangePasswordViewPage.qml index cf134bd923..ebc35a3517 100644 --- a/storybook/pages/ChangePasswordViewPage.qml +++ b/storybook/pages/ChangePasswordViewPage.qml @@ -37,6 +37,23 @@ SplitView { signal storeToKeychainError(errorDescription: string) signal storeToKeychainSuccess() } + + function tryStoreToKeyChain(errorDescription) { + if (generateMacKeyChainStoreError.checked) { + privacyModule.storeToKeychainError(errorDescription) + } else { + privacyModule.storeToKeychainSuccess() + privacyModule.passwordChanged(true, "") + } + } + + function tryRemoveFromKeyChain() { + if (generateMacKeyChainStoreError.checked) { + privacyModule.storeToKeychainError(errorDescription) + } else { + privacyModule.storeToKeychainSuccess() + } + } } property QtObject localAccountSettings: QtObject { @@ -54,7 +71,11 @@ SplitView { logsView.logText: logs.logText RowLayout { - + Switch { + id: generateMacKeyChainStoreError + text: "Generate key chain error" + checked: false + } } } } diff --git a/ui/app/AppLayouts/Profile/views/ChangePasswordView.qml b/ui/app/AppLayouts/Profile/views/ChangePasswordView.qml index 07c151bed1..29d8741c51 100644 --- a/ui/app/AppLayouts/Profile/views/ChangePasswordView.qml +++ b/ui/app/AppLayouts/Profile/views/ChangePasswordView.qml @@ -25,15 +25,20 @@ SettingsContentBase { readonly property bool biometricsEnabled: localAccountSettings.storeToKeychainValue === Constants.keychain.storedValue.store + readonly property StatusSwitch biometricsSwitch: titleRowComponentLoader.item.switchItem readonly property Connections privacyStoreConnections: Connections { target: Qt.platform.os === Constants.mac ? root.privacyStore.privacyModule : null function onStoreToKeychainError(errorDescription: string) { - biometricsSwitch.checked = Qt.binding(() => { return biometricsSwitch.currentStoredValue }) + root.biometricsSwitch.checked = Qt.binding(() => { + return root.biometricsSwitch.currentStoredValue + }) } function onStoreToKeychainSuccess() { - biometricsSwitch.checked = Qt.binding(() => { return biometricsSwitch.currentStoredValue }) + root.biometricsSwitch.checked = Qt.binding(() => { + return root.biometricsSwitch.currentStoredValue + }) } } @@ -43,14 +48,22 @@ SettingsContentBase { implicitWidth: 226 implicitHeight: 38 visible: (Qt.platform.os === Constants.mac) + + property StatusSwitch switchItem: biometricsSwitch StatusSwitch { id: biometricsSwitch + LayoutMirroring.enabled: true LayoutMirroring.childrenInherit: true + text: qsTr("Enable biometrics") textColor: Theme.palette.baseColor1 + + property bool currentStoredValue: false + checked: root.biometricsEnabled onToggled: { + currentStoredValue = checked enableBiometricsPopup.open(); } StatusToolTip {