Skip to content

Commit

Permalink
revert: remove force call
Browse files Browse the repository at this point in the history
  • Loading branch information
dbajpeyi committed Oct 9, 2024
1 parent 285359e commit 4c04430
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 30 deletions.
9 changes: 3 additions & 6 deletions dist/autofill-debug.js

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

9 changes: 3 additions & 6 deletions dist/autofill.js

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

2 changes: 1 addition & 1 deletion src/CredentialsImport.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class CredentialsImport {

async refresh () {
// Force refresh all settings (e.g availableInputTypes)
await this.device.settings.refresh(true)
await this.device.settings.refresh()

// Re-decorate all inputs to show the input decorations
this.device.activeForm?.redecorateAllInputs()
Expand Down
9 changes: 4 additions & 5 deletions src/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,17 +151,16 @@ export class Settings {
* Available Input Types are boolean indicators to represent which input types the
* current **user** has data available for.
*
* @param {boolean} shouldForce - if true, will always call the native app. If false, will return the cached value.
* @returns {Promise<AvailableInputTypes>}
*/
async getAvailableInputTypes (shouldForce = false) {
async getAvailableInputTypes () {
try {
// This info is not needed in the topFrame, so we avoid calling the native app
if (this.globalConfig.isTopFrame) {
return Settings.defaults.availableInputTypes
}

if (this._availableInputTypes && !shouldForce) {
if (this._availableInputTypes) {
return this.availableInputTypes
}

Expand All @@ -185,10 +184,10 @@ export class Settings {
* enabled: boolean | null
* }>}
*/
async refresh (shouldForceAvailalbeInputTypes = false) {
async refresh () {
this.setEnabled(await this.getEnabled())
this.setFeatureToggles(await this.getFeatureToggles())
this.setAvailableInputTypes(await this.getAvailableInputTypes(shouldForceAvailalbeInputTypes))
this.setAvailableInputTypes(await this.getAvailableInputTypes())
this.setLanguage(await this.getLanguage())

// If 'this.enabled' is a boolean it means we were able to set it correctly and therefor respect its value
Expand Down
9 changes: 3 additions & 6 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.

9 changes: 3 additions & 6 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 4c04430

Please sign in to comment.