1
0
mirror of https://github.com/bitwarden/desktop.git synced 2024-11-18 10:55:48 +01:00

return results even when domain is not parsable

This commit is contained in:
Kyle Spearrin 2017-10-17 23:54:19 -04:00
parent dadecf2f4d
commit 95c0a5ace2
2 changed files with 6 additions and 8 deletions

View File

@ -33,12 +33,6 @@ angular
}
domain = utilsService.getDomain(url);
if (!domain) {
$timeout(function () {
$scope.loaded = true;
});
return;
}
chrome.tabs.sendMessage(tabs[0].id, {
command: 'collectPageDetails',

View File

@ -263,7 +263,11 @@ function initCipherService() {
CipherService.prototype.getAllDecryptedForDomain = function (domain, includeOtherTypes) {
var self = this;
var eqDomainsPromise = self.settingsService.getEquivalentDomains().then(function (eqDomains) {
if (!domain && !includeOtherTypes) {
return Q([]);
}
var eqDomainsPromise = !domain ? Q([]) : self.settingsService.getEquivalentDomains().then(function (eqDomains) {
var matchingDomains = [];
for (var i = 0; i < eqDomains.length; i++) {
if (eqDomains[i].length && eqDomains[i].indexOf(domain) >= 0) {
@ -284,7 +288,7 @@ function initCipherService() {
ciphersToReturn = [];
for (var i = 0; i < ciphers.length; i++) {
if (ciphers[i].type === self.constantsService.cipherType.login && ciphers[i].login.domain &&
if (domain && ciphers[i].type === self.constantsService.cipherType.login && ciphers[i].login.domain &&
matchingDomains.indexOf(ciphers[i].login.domain) > -1) {
ciphersToReturn.push(ciphers[i]);
}