Skip to content

Commit

Permalink
add default location rome
Browse files Browse the repository at this point in the history
  • Loading branch information
ufaboy committed Jan 18, 2024
1 parent 9f673a4 commit 7c2fc69
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions src/components/WeatherItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function getWeatherSummary(data: WeatherResponse) {
return `Feels like ${data.main.feels_like}, ${data.weather[0].description}`;
}
onMounted(async () => {
weatherData.value = await getWeather<LocationData>(props.location);
weatherData.value = await getWeather<WeatherResponse>(props.location);
if (weatherData.value) {
emit('update', weatherData.value);
}
Expand Down Expand Up @@ -60,7 +60,4 @@ onMounted(async () => {
</div>
</div>
</div>
<div v-else id="fallback" class="">
Pls
</div>
</template>
2 changes: 1 addition & 1 deletion src/pages/WeatherList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const emit = defineEmits<{
const locations = ref<LocationData[]>(loadLocationsFromStorage())
function errorPositionHandler() {
console.error('errorPositionHandler');
locations.value.push({ latitude: 41.9028, longitude: 12.4964 })
}
function updateLocation(event: WeatherResponse, index: number) {
locations.value[index] = { city: event.name, country: event.sys.country, latitude: event.coord.lat, longitude: event.coord.lon }
Expand Down

0 comments on commit 7c2fc69

Please sign in to comment.