Skip to content

Commit

Permalink
Merge pull request #14 from duckduckgo/ema/android-fixes
Browse files Browse the repository at this point in the history
Android fixes
  • Loading branch information
GioSensation authored Aug 3, 2021
2 parents f8ae3c1 + c23356f commit 8a08e93
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
7 changes: 6 additions & 1 deletion dist/autofill.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,12 @@ class AndroidInterface extends InterfacePrototype {
alias
}) => alias);

this.isDeviceSignedIn = () => window.EmailInterface.isSignedIn() === 'true';
this.isDeviceSignedIn = () => {
// isDeviceSignedIn is only available on DDG domains...
if (isDDGDomain()) return window.EmailInterface.isSignedIn() === 'true'; // ...on other domains we assume true because the script wouldn't exist otherwise

return true;
};

this.setupAutofill = ({
shouldLog
Expand Down
8 changes: 7 additions & 1 deletion src/DeviceInterface.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,13 @@ class AndroidInterface extends InterfacePrototype {
window.EmailInterface.showTooltip(), 'getAliasResponse')
.then(({alias}) => alias)

this.isDeviceSignedIn = () => window.EmailInterface.isSignedIn() === 'true'
this.isDeviceSignedIn = () => {
// isDeviceSignedIn is only available on DDG domains...
if (isDDGDomain()) return window.EmailInterface.isSignedIn() === 'true'

// ...on other domains we assume true because the script wouldn't exist otherwise
return true
}

this.setupAutofill = ({shouldLog} = {shouldLog: false}) => {
if (this.isDeviceSignedIn()) {
Expand Down

0 comments on commit 8a08e93

Please sign in to comment.