From ae92645f4b2fb4ba25fb74bfc2bfd3a6700ec3c6 Mon Sep 17 00:00:00 2001 From: Quincy Morgan Date: Wed, 13 Mar 2019 13:49:23 -0400 Subject: [PATCH] Only show five most recent presets in ribbon --- modules/ui/modes.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/ui/modes.js b/modules/ui/modes.js index b25ce0ba0..9cd5c46e4 100644 --- a/modules/ui/modes.js +++ b/modules/ui/modes.js @@ -91,7 +91,13 @@ export function uiModes(context) { items = _uniqWith(items.concat(context.presets().getRecents()), function(item1, item2) { return item1.matches(item2.preset, item2.geometry); }); - items = items.slice(0, 10); + var maxShown = 10; + var maxRecents = 5; + if (favoritesCount < maxRecents) { + // only show five most recent at most + maxShown = maxRecents + favoritesCount; + } + items = items.slice(0, maxShown); } var modes = items.map(function(d, index) {