Bug 1518786 - Remove translations from the pending queue if there is a caller that is waiting on the specific translations. r=zbraniecki

Differential Revision: https://phabricator.services.mozilla.com/D16588

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jared Wein 2019-01-16 20:54:36 +00:00
parent e79eecd7af
commit 64abb2f9b4

View File

@ -755,6 +755,12 @@ class DOMLocalization extends Localization {
return undefined;
}
// Remove elements from the pending list since
// their translations will get applied below.
for (let element of elements) {
this.pendingElements.delete(element);
}
const keys = elements.map(this.getKeysForElement);
const translations = await this.formatMessages(keys);
return this.applyTranslations(elements, translations);