commit 7da0fe7ad05b50c11085e7b9af65004046a28659 parent 6658584154fe7b75f4a7059ba63c9155a11753da Author: Sergey Orlov <wladimirych@gmail.com> Date: Thu, 23 Jul 2020 09:40:16 +0200 hash state: do not urldecode all values by default Decoding values broke loading state for new search control: nktl= part in search query caused track to be loaded. Diffstat:
M | src/lib/leaflet.control.track-list/lib/services/nakarte/index.js | | | 4 | ++-- |
M | src/lib/leaflet.hashState/hashState.js | | | 1 | - |
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/lib/leaflet.control.track-list/lib/services/nakarte/index.js b/src/lib/leaflet.control.track-list/lib/services/nakarte/index.js @@ -86,11 +86,11 @@ class NakarteUrlLoader { } async loadFromUrlencodedUrls(values) { - return flattenArray(await Promise.all(values.map(loadFromUrl))); + return flattenArray(await Promise.all(values.map(decodeURIComponent).map(loadFromUrl))); } async loadPoint(values) { - return parsePointFromHashValues(values); + return parsePointFromHashValues(values.map(decodeURIComponent)); } } diff --git a/src/lib/leaflet.hashState/hashState.js b/src/lib/leaflet.hashState/hashState.js @@ -22,7 +22,6 @@ function parseHashParams(s) { [, key, value] = m; if (value) { value = value.split('/'); - value = value.map(decodeURIComponent); } else { value = []; }