a little linting, but not all the linting
This commit is contained in:
parent
efb83255fd
commit
d98d0f1697
2 changed files with 5 additions and 7 deletions
|
@ -632,13 +632,13 @@ async function restore(inSync) {
|
|||
const browserIdentities = await browser.contextualIdentities.query({});
|
||||
|
||||
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);
|
||||
if (!match) {
|
||||
browser.contextualIdentities.create({name: syncIdentity.name, color: syncIdentity.color, icon: syncIdentity.icon});
|
||||
continue;
|
||||
} 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);
|
||||
continue;
|
||||
}
|
||||
|
@ -655,14 +655,14 @@ async function restoreFirstRun(inSync) {
|
|||
const browserIdentities = await browser.contextualIdentities.query({});
|
||||
const syncIdentities = 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);
|
||||
if (!match) {
|
||||
newIdentity = await browser.contextualIdentities.create({name: syncIdentity.name, color: syncIdentity.color, icon: syncIdentity.icon});
|
||||
identityState.updateUUID(newIdentity.cookieStoreId, syncIdentity.macUUID);
|
||||
continue;
|
||||
} 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);
|
||||
continue;
|
||||
}
|
||||
|
@ -678,7 +678,7 @@ async function restoreFirstRun(inSync) {
|
|||
if (assignedSitesBrowser.hasOwnProperty(key)) {
|
||||
const syncCookieStoreId = "firefox-container-" + syncAssignedSites[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;
|
||||
} else {
|
||||
// ask user
|
||||
|
|
|
@ -77,12 +77,10 @@ const identityState = {
|
|||
},
|
||||
|
||||
async lookupCookieStoreId(macUUID) {
|
||||
console.log("luCSI");
|
||||
const macConfigs = await this.storageArea.area.get();
|
||||
for(const key of Object.keys(macConfigs)) {
|
||||
if (key.includes("identitiesState@@_")) {
|
||||
if(macConfigs[key].macUUID === macUUID) {
|
||||
console.log(key);
|
||||
return key.replace(/^firefox-container-@@_/, "");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue