[gnome-maps] placeButtons: Fix bug when adding favorites



commit 10a497881555a91752e59c4d40882a5283c47a3f
Author: James Westman <james flyingpimonster net>
Date:   Tue Jan 5 12:48:17 2021 -0600

    placeButtons: Fix bug when adding favorites
    
    When you searched for a place in your Recents list, then added it to your
    Favorites through the PlaceBar, it would lose all its Overpass information.
    Fixed by always using the PlaceStore version of a place in PlaceButtons.
    
    See also #322.

 src/placeButtons.js | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/src/placeButtons.js b/src/placeButtons.js
index f51e29ab..24624f84 100644
--- a/src/placeButtons.js
+++ b/src/placeButtons.js
@@ -67,6 +67,12 @@ var PlaceButtons = GObject.registerClass({
 
     set place(newPlace) {
         this._place = newPlace;
+        /* Use the PlaceStore's version of a place, if available. */
+        if (Application.placeStore.exists(newPlace, null)) {
+            this._place = Application.placeStore.get(newPlace);
+        } else {
+            this._place = newPlace;
+        }
 
         this._updateFavoriteButton(!!this._place.store);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]