[gnome-maps/wip/mlundblad/fix-search-caching-race] placeEntry: Use previously stored search term for caching




commit 102f131e5141324480f7d95c9db5321cd3a7edff
Author: Marcus Lundblad <ml update uu se>
Date:   Tue Oct 6 22:56:15 2020 +0200

    placeEntry: Use previously stored search term for caching
    
    When caching search results use previously saved search string
    as the "text" property could change before the callback was called.

 src/placeEntry.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/placeEntry.js b/src/placeEntry.js
index 494784d9..3f0749f6 100644
--- a/src/placeEntry.js
+++ b/src/placeEntry.js
@@ -266,7 +266,7 @@ var PlaceEntry = GObject.registerClass({
                 this._updateResults(places);
 
                 // cache results for later
-                this._cache[this.text] = places;
+                this._cache[this._previousSearch] = places;
             }
 
             // if search input has been updated, trigger a refresh


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