Skip to content

Commit

Permalink
fix(TranslateService): don't change lang if it's already selected
Browse files Browse the repository at this point in the history
  • Loading branch information
macjohnny authored and ocombe committed Jul 17, 2017
1 parent 942011c commit ef56200
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/translate.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,11 @@ export class TranslateService {
* @returns {Observable<*>}
*/
public use(lang: string): Observable<any> {
// don't change the language if the language given is already selected
if(lang === this.currentLang) {
return Observable.of(this.translations[lang]);
}

let pending: Observable<any> = this.retrieveTranslations(lang);

if(typeof pending !== "undefined") {
Expand Down

0 comments on commit ef56200

Please sign in to comment.