[bug] Point autofill at the correct storage key

This commit is contained in:
addison 2022-02-07 11:40:27 -05:00
parent 2844e06aa8
commit 693e1e76b5
1 changed files with 12 additions and 3 deletions

View File

@ -3,9 +3,18 @@ document.addEventListener("DOMContentLoaded", (event) => {
let filledThisHref = false; let filledThisHref = false;
let delayFillTimeout: number; let delayFillTimeout: number;
const enabledKey = "enableAutoFillOnPageLoad"; const activeUserIdKey = "activeUserId";
chrome.storage.local.get(enabledKey, (obj: any) => { let activeUserId: string;
if (obj != null && obj[enabledKey] === true) {
chrome.storage.local.get(activeUserIdKey, (obj: any) => {
if (obj == null || obj[activeUserIdKey] == null) {
return;
}
activeUserId = obj[activeUserIdKey];
});
chrome.storage.local.get(activeUserId, (obj: any) => {
if (obj != null && obj[activeUserId].settings.enableAutoFillOnPageLoad === true) {
setInterval(() => doFillIfNeeded(), 500); setInterval(() => doFillIfNeeded(), 500);
} }
}); });