a little linting, but not all the linting

This commit is contained in:
Kendall Werts 2019-12-16 14:59:11 -06:00
parent efb83255fd
commit d98d0f1697
2 changed files with 5 additions and 7 deletions

View file

@ -632,13 +632,13 @@ async function restore(inSync) {
const browserIdentities = await browser.contextualIdentities.query({}); const browserIdentities = await browser.contextualIdentities.query({});
for (const syncIdentity of syncIdentities) { for (const syncIdentity of syncIdentities) {
const compareNames = function (browserIdentity) { return (browserIdentity.name == syncIdentity.name); }; const compareNames = function (browserIdentity) { return (browserIdentity.name === syncIdentity.name); };
const match = browserIdentities.find(compareNames); const match = browserIdentities.find(compareNames);
if (!match) { if (!match) {
browser.contextualIdentities.create({name: syncIdentity.name, color: syncIdentity.color, icon: syncIdentity.icon}); browser.contextualIdentities.create({name: syncIdentity.name, color: syncIdentity.color, icon: syncIdentity.icon});
continue; continue;
} else { } else {
if (syncIdentity.color == match.color && syncIdentity.icon == match.icon) { if (syncIdentity.color === match.color && syncIdentity.icon === match.icon) {
console.log("everything is the same:", syncIdentity, match); console.log("everything is the same:", syncIdentity, match);
continue; continue;
} }
@ -655,14 +655,14 @@ async function restoreFirstRun(inSync) {
const browserIdentities = await browser.contextualIdentities.query({}); const browserIdentities = await browser.contextualIdentities.query({});
const syncIdentities = inSync.identities; const syncIdentities = inSync.identities;
for (const syncIdentity of inSync.identities) { for (const syncIdentity of inSync.identities) {
const compareNames = function (browserIdentity) { return (browserIdentity.name == syncIdentity.name); }; const compareNames = function (browserIdentity) { return (browserIdentity.name === syncIdentity.name); };
const match = browserIdentities.find(compareNames); const match = browserIdentities.find(compareNames);
if (!match) { if (!match) {
newIdentity = await browser.contextualIdentities.create({name: syncIdentity.name, color: syncIdentity.color, icon: syncIdentity.icon}); newIdentity = await browser.contextualIdentities.create({name: syncIdentity.name, color: syncIdentity.color, icon: syncIdentity.icon});
identityState.updateUUID(newIdentity.cookieStoreId, syncIdentity.macUUID); identityState.updateUUID(newIdentity.cookieStoreId, syncIdentity.macUUID);
continue; continue;
} else { } else {
if (syncIdentity.color == match.color && syncIdentity.icon == match.icon) { if (syncIdentity.color === match.color && syncIdentity.icon === match.icon) {
console.log("everything is the same:", syncIdentity, match); console.log("everything is the same:", syncIdentity, match);
continue; continue;
} }
@ -678,7 +678,7 @@ async function restoreFirstRun(inSync) {
if (assignedSitesBrowser.hasOwnProperty(key)) { if (assignedSitesBrowser.hasOwnProperty(key)) {
const syncCookieStoreId = "firefox-container-" + syncAssignedSites[key].userContextId; const syncCookieStoreId = "firefox-container-" + syncAssignedSites[key].userContextId;
const browserCookieStoreId = "firefox-container-" + assignedSitesBrowser[key].userContextId; const browserCookieStoreId = "firefox-container-" + assignedSitesBrowser[key].userContextId;
if (inSync.cookieStoreIDmap[syncCookieStoreId] == identityState.storageArea.get(browserCookieStoreId).macUUID) { if (inSync.cookieStoreIDmap[syncCookieStoreId] === identityState.storageArea.get(browserCookieStoreId).macUUID) {
continue; continue;
} else { } else {
// ask user // ask user

View file

@ -77,12 +77,10 @@ const identityState = {
}, },
async lookupCookieStoreId(macUUID) { async lookupCookieStoreId(macUUID) {
console.log("luCSI");
const macConfigs = await this.storageArea.area.get(); const macConfigs = await this.storageArea.area.get();
for(const key of Object.keys(macConfigs)) { for(const key of Object.keys(macConfigs)) {
if (key.includes("identitiesState@@_")) { if (key.includes("identitiesState@@_")) {
if(macConfigs[key].macUUID === macUUID) { if(macConfigs[key].macUUID === macUUID) {
console.log(key);
return key.replace(/^firefox-container-@@_/, ""); return key.replace(/^firefox-container-@@_/, "");
} }
} }