[gnome-maps/gnome-3-36] placeEntry: Use previously stored search term for caching



commit 2e0148f182587741ebf292fd6be360975c59c676
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 1e22e39f..268d48f6 100644
--- a/src/placeEntry.js
+++ b/src/placeEntry.js
@@ -259,7 +259,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
             if (this.text !== this._previousSearch)


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