From 523f424269529a5051be9066e27dbd561021f5e2 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Mon, 13 Feb 2023 16:24:37 -0500 Subject: [PATCH] Bump recent presets from 4 to 6 (re: openstreetmap/iD#9454) --- modules/presets/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/presets/index.js b/modules/presets/index.js index 0661d81d9b..743cb68bd3 100644 --- a/modules/presets/index.js +++ b/modules/presets/index.js @@ -25,7 +25,9 @@ export { _mainPresetIndex as presetManager }; // export function presetIndex() { const dispatch = d3_dispatch('favoritePreset', 'recentsChange'); - const MAXRECENTS = 30; + const MAXRECENTS = 30; // how many recents to store in localstorage + const MAXRECENTS_SHOW = 6; // how many recents to show on the preset list + // seed the preset lists with geometry fallbacks const POINT = presetPreset('point', { name: 'Point', tags: {}, geometry: ['point', 'vertex'], matchScore: 0.1 } ); @@ -387,7 +389,7 @@ if (presetID === 'highway/crossing/traffic_signals') p.icon ='temaki-pedestrian_ _this.defaults = (geometry, n, startWithRecents, loc) => { let recents = []; if (startWithRecents) { - recents = _this.recent().matchGeometry(geometry).collection.slice(0, 4); + recents = _this.recent().matchGeometry(geometry).collection.slice(0, MAXRECENTS_SHOW); } let defaults;