Skip to content

Commit

Permalink
style: minor PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dbajpeyi committed Dec 6, 2024
1 parent c6b596f commit 8f1e476
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions dist/autofill-debug.js

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

6 changes: 3 additions & 3 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/DeviceInterface/InterfacePrototype.js
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ class InterfacePrototype {
if (!form.form) return;
if (!form.hasValues(values)) return;

const isUsernameOnly = Object.keys(values?.credentials ?? {}).length === 1 && values?.credentials?.username;
const isUsernameOnly = Object.keys(values?.credentials || {}).length === 1 && values?.credentials?.username;
const checks = [form.shouldPromptToStoreData && !form.submitHandlerExecuted, this.passwordGenerator.generated, isUsernameOnly];
if (checks.some(Boolean)) {
const formData = appendGeneratedKey(values, {
Expand Down
2 changes: 1 addition & 1 deletion src/Form/formatters.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ const prepareFormValuesForStorage = (formValues) => {
/** Fixes for credentials */
if (!credentials.username && hasUsernameLikeIdentity(identities)) {
// @ts-ignore - We know that username is not a useful value here
credentials.username = identities.emailAddress ?? identities.phone;
credentials.username = identities.emailAddress || identities.phone;
}

// If we still don't have any credentials, we discard the object
Expand Down
2 changes: 1 addition & 1 deletion src/autofill-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ function queryElementsWithShadow(element, selector, forceScanShadowTree = false)
}

/**
* Checks if there's only one identity in the object, and it's a username-like identity
* Checks if there is a single username-like identity, i.e. email or phone
* @param {InternalIdentityObject} identities
* @returns {boolean}
*/
Expand Down
6 changes: 3 additions & 3 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.

6 changes: 3 additions & 3 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 8f1e476

Please sign in to comment.