From bbdec163adc1675db19c751e8121475df96bba96 Mon Sep 17 00:00:00 2001 From: JuliaSvinareva Date: Tue, 15 Feb 2022 20:23:15 +0300 Subject: [PATCH] [DE PE SSE] Fix shape menu component --- apps/common/main/lib/component/DataView.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/apps/common/main/lib/component/DataView.js b/apps/common/main/lib/component/DataView.js index 80f5a65fa..3444a6c88 100644 --- a/apps/common/main/lib/component/DataView.js +++ b/apps/common/main/lib/component/DataView.js @@ -1579,11 +1579,8 @@ define([ selected: false, groupName: groupName }; - me.recentShapes.unshift(model); - if (me.recentShapes.length > 12) { - me.recentShapes.splice(12, 1); - } - Common.localStorage.setItem(this.appPrefix + 'recent-shapes', JSON.stringify(me.recentShapes)); + var arr = [model].concat(me.recentShapes.slice(0, 11)); + Common.localStorage.setItem(this.appPrefix + 'recent-shapes', JSON.stringify(arr)); me.recentShapes = undefined; }, updateRecents: function () {