Skip to content

Commit

Permalink
fix incorrect cache handling
Browse files Browse the repository at this point in the history
  • Loading branch information
jemikanegara committed May 10, 2024
1 parent de047c6 commit f06917a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ function processTextNodes(textNodes = [], language = "", apiKey = "") {
// If there are translations not in cache, fetch them from the API
const response = notCachedInCDN.length ? await getTranslationsFromAPI(notCachedInCDN, language, apiKey) : [];

notInCache.forEach((text, index) => {
notCachedInCDN.forEach((text, index) => {
// Cache the new translations
if (window.translationCache?.[window.location.pathname]?.[language]) {
window.translationCache[window.location.pathname][language][text] = response[index] || cacheFromCloudFlare[text] || text;
Expand Down

0 comments on commit f06917a

Please sign in to comment.