Skip to content

Commit

Permalink
put shallow copy in []
Browse files Browse the repository at this point in the history
  • Loading branch information
lukarenko committed Nov 6, 2024
1 parent 9b54754 commit e1ef60a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/components/maps/leafletMapMoorages.vue
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@
map.value.fitBounds(layer.getBounds(), { maxZoom: 17 })
if (props.moorageMapId != 0) {
map.value.flyTo(...coord.reverse(), props.mapZoom)
map.value.flyTo([...coord].reverse(), props.mapZoom)
}
// only for moorages maps
if (props.moorageMapId == 0) {
Expand Down Expand Up @@ -376,7 +376,7 @@
map.value.off('moveend', openPopupClick)
}
console.log(`navigate to Moorage: ${coordinates}`)
map.value.flyTo(...coordinates.reverse(), 15)
map.value.flyTo([...coordinates].reverse(), 15)
map.value.on('moveend', openPopupClick)
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/dashboard/Dashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@
try {
// Duplicate json ref to keep origin geojson valid
const geojson = monitoring.value.geojson.geometry.coordinates.map((x) => x)
await fetchWeatherForecast(...geojson.reverse())
await fetchWeatherForecast([...geojson].reverse())
console.log('Dashboard onMounted currentWeather.value', currentWeather.value)
} catch (err) {
console.log('fetchWeatherForecast failed', err)
Expand Down
2 changes: 1 addition & 1 deletion src/pages/eventlogs/Timelines.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
console.log('Event Logs', response)
if (Array.isArray(response)) {
rowsData.value.splice(0, rowsData.value.length || [])
rowsData.value.push(...response.reverse())
rowsData.value.push([...response].reverse())
console.log('Event Logs', rowsData.value)
} else {
throw { response }
Expand Down

0 comments on commit e1ef60a

Please sign in to comment.