[bug] Point autofill at the correct storage key

This commit is contained in:
addison 2022-02-07 11:40:27 -05:00
parent 65b493cce0
commit 9d37811986
1 changed files with 12 additions and 3 deletions

View File

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