fix(settings) fix toggle button for change password screen
Updates #13898
This commit is contained in:
parent
69312aed29
commit
db6e24e4c3
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue