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

Commit

Permalink
fix(service): $nextLang should be not unset parallel loadings
Browse files Browse the repository at this point in the history
resolves #647
  • Loading branch information
knalli committed Sep 18, 2014
1 parent b685601 commit d1745e4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/service/translate.js
Original file line number Diff line number Diff line change
Expand Up @@ -1455,12 +1455,14 @@ angular.module('pascalprecht.translate').provider('$translate', ['$STORAGE_KEY',
translations(translation.key, translation.table);
deferred.resolve(translation.key);

useLanguage(translation.key);
if ($nextLang === key) {
useLanguage(translation.key);
$nextLang = undefined;
}
}, function (key) {
$nextLang = undefined;
if ($nextLang === key) {
$nextLang = undefined;
}
$rootScope.$emit('$translateChangeError', {language: key});
deferred.reject(key);
$rootScope.$emit('$translateChangeEnd', {language: key});
Expand Down

0 comments on commit d1745e4

Please sign in to comment.