Properly handle place removals
* Transition to OSM route or index instead of staying on ghost route/ID (closes sidebar if it was a custom place) * Ensure save button and lists are in the correct state
This commit is contained in:
@@ -282,11 +282,22 @@ export default class StorageService extends Service {
|
||||
let place = this.savedPlaces.find((p) => p.id && String(p.id) === strId);
|
||||
if (place) return place;
|
||||
|
||||
// Check placesInView as fallback
|
||||
place = this.placesInView.find((p) => p.id && String(p.id) === strId);
|
||||
if (place) return place;
|
||||
|
||||
// Then search by OSM ID
|
||||
place = this.savedPlaces.find((p) => p.osmId && String(p.osmId) === strId);
|
||||
if (place) return place;
|
||||
|
||||
place = this.placesInView.find((p) => p.osmId && String(p.osmId) === strId);
|
||||
return place;
|
||||
}
|
||||
|
||||
isPlaceSaved(id) {
|
||||
return !!this.findPlaceById(id);
|
||||
}
|
||||
|
||||
async storePlace(placeData) {
|
||||
const savedPlace = await this.places.store(placeData);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user