Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

Commit

Permalink
fix(translateService): prevent multiple XHR calls
Browse files Browse the repository at this point in the history
  • Loading branch information
0x-r4bbit committed Aug 3, 2014
1 parent acab18a commit b48f6bb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/service/translate.js
Original file line number Diff line number Diff line change
Expand Up @@ -1389,7 +1389,7 @@ angular.module('pascalprecht.translate').provider('$translate', ['$STORAGE_KEY',

// if there isn't a translation table for the language we've requested,
// we load it asynchronously
if (!$translationTable[key] && $loaderFactory) {
if (!$translationTable[key] && $loaderFactory && !langPromises[key]) {
$nextLang = key;
langPromises[key] = loadAsync(key).then(function (translation) {
translations(translation.key, translation.table);
Expand Down

0 comments on commit b48f6bb

Please sign in to comment.