Skip to content

Commit

Permalink
hotfix location service which breaks in minification process
Browse files Browse the repository at this point in the history
  • Loading branch information
roncodes committed Feb 9, 2024
1 parent 9ce45d0 commit fb238a4
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
18 changes: 10 additions & 8 deletions addon/services/location.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,16 @@ export default class LocationService extends Service {

if (isArray(coordinates)) {
const validCoordinates = coordinates.filter((point) => point.coordinates[0] !== 0);
const [longitude, latitude] = getWithDefault(validCoordinates, '0.coordinates', [0, 0]);
const coordinates = {
latitude,
longitude,
};

this.updateLocation(coordinates);
return coordinates;
if (validCoordinates) {
const [longitude, latitude] = getWithDefault(validCoordinates, '0.coordinates', [0, 0]);
const userCoordinates = {
latitude,
longitude,
};

this.updateLocation(userCoordinates);
return userCoordinates;
}
}

return this.getUserLocationFromWhois();
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fleetbase/fleetops-api",
"version": "0.4.7",
"version": "0.4.8",
"description": "Fleet & Transport Management Extension for Fleetbase",
"keywords": [
"fleetbase-extension",
Expand All @@ -22,7 +22,7 @@
],
"require": {
"php": "^8.0",
"fleetbase/core-api": "^1.4.0",
"fleetbase/core-api": "^1.4.1",
"barryvdh/laravel-dompdf": "^2.0",
"brick/geo": "0.7.2",
"cknow/laravel-money": "^7.1",
Expand Down
2 changes: 1 addition & 1 deletion extension.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Fleet-Ops",
"version": "0.4.7",
"version": "0.4.8",
"description": "Fleet & Transport Management Extension for Fleetbase",
"repository": "https://github.com/fleetbase/fleetops",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fleetbase/fleetops-engine",
"version": "0.4.7",
"version": "0.4.8",
"description": "Fleet & Transport Management Extension for Fleetbase",
"fleetbase": {
"route": "fleet-ops"
Expand Down

0 comments on commit fb238a4

Please sign in to comment.