Fix live current & best dates in popup
This commit is contained in:
parent
3f2ba8bd2a
commit
90a58961d4
@ -150,22 +150,20 @@ function smoothTextChange(element, newText) {
|
||||
});
|
||||
// update current & best dates
|
||||
chrome.storage.onChanged.addListener((changes, area) => {
|
||||
if (area === 'local' && changes.ctx_consulates) {
|
||||
if (changes.ctx_consulates) {
|
||||
const newConsulates = changes.ctx_consulates.newValue;
|
||||
|
||||
for (let c in newConsulates) {
|
||||
if (newConsulates[c].currentDate) {
|
||||
let el = document.getElementById(`currentDate-${c}`);
|
||||
let el = document.getElementById(`currentDate-${cId}`);
|
||||
if (el && el.innerText != newConsulates[c].currentDate)
|
||||
smoothTextChange(el, newConsulates[c].currentDate);
|
||||
}
|
||||
if (newConsulates[c].bestDate) {
|
||||
let el = document.getElementById(`bestDate-${c}`);
|
||||
let el = document.getElementById(`bestDate-${cId}`);
|
||||
if (el && el.innerText != newConsulates[c].bestDate)
|
||||
smoothTextChange(el, newConsulates[c].bestDate);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user