Skip to content

Commit

Permalink
fix country language on home page
Browse files Browse the repository at this point in the history
  • Loading branch information
icepick4 committed Jul 2, 2023
1 parent 2aa0def commit f7bc22c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Planet from '../components/Planet.vue';
import { CountryI } from '../models/Country';
import { User } from '../models/User';
import ApiService from '../services/apiService';
import { getLanguage } from '../utils/common';
const countries = ref<CountryI[]>([]);
const store = useStore();
Expand Down Expand Up @@ -54,8 +55,9 @@ const scrollTo = (id: string) => {
};
onBeforeMount(async () => {
let lang = getLanguage();
try {
let fetchedCountries = await ApiService.getCountries(8, 'en');
let fetchedCountries = await ApiService.getCountries(8, lang);
countries.value = fetchedCountries
.concat(fetchedCountries)
.concat(fetchedCountries);
Expand Down

0 comments on commit f7bc22c

Please sign in to comment.