Skip to content

Commit

Permalink
Fix prompting to store data
Browse files Browse the repository at this point in the history
Signed-off-by: Emanuele Feliziani <[email protected]>
  • Loading branch information
GioSensation committed Jan 26, 2024
1 parent b8d5b66 commit dbad7ba
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 20 deletions.
11 changes: 7 additions & 4 deletions dist/autofill-debug.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions dist/autofill.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions src/Form/Form.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class Form {
// We set this to true to skip event listeners while we're autofilling
this.isAutofilling = false
this.submitHandlerExecuted = false
this.shouldPromptToStoreData = true
this.shouldPromptToStoreData = deviceInterface.settings.featureToggles.credentials_saving
this.shouldAutoSubmit = this.device.globalConfig.isMobileApp

/**
Expand Down Expand Up @@ -294,8 +294,8 @@ class Form {
// This ensures we are not removing the highlight ourselves when autofilling more than once
if (e && !e.isTrusted) return

// If the user has changed the value, we prompt to update the stored data
this.shouldPromptToStoreData = true
// If the user has changed the value, reset shouldPromptToStoreData to initial value
this.resetShouldPromptToStoreData()

this.execOnInputs((input) => this.removeInputHighlight(input), dataType)
}
Expand Down Expand Up @@ -355,6 +355,9 @@ class Form {
if (this.activeInput) this.activeInput.focus()
this.matching.clear()
}
resetShouldPromptToStoreData () {
this.shouldPromptToStoreData = this.device.settings.featureToggles.credentials_saving
}
dismissTooltip () {
this.removeTooltip()
}
Expand All @@ -375,7 +378,7 @@ class Form {
// console.log('typing class body', this.isAutofilling)
if (!this.isAutofilling) {
this.submitHandlerExecuted = false
this.shouldPromptToStoreData = true
this.resetShouldPromptToStoreData()
}
})

Expand Down
11 changes: 7 additions & 4 deletions swift-package/Resources/assets/autofill-debug.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions swift-package/Resources/assets/autofill.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit dbad7ba

Please sign in to comment.