aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/sonar-web/src/main/js/app/components/nav/component/RecentHistory.js8
1 files changed, 3 insertions, 5 deletions
diff --git a/server/sonar-web/src/main/js/app/components/nav/component/RecentHistory.js b/server/sonar-web/src/main/js/app/components/nav/component/RecentHistory.js
index 6454cfe8afb..e7dc3f06f09 100644
--- a/server/sonar-web/src/main/js/app/components/nav/component/RecentHistory.js
+++ b/server/sonar-web/src/main/js/app/components/nav/component/RecentHistory.js
@@ -17,8 +17,6 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import _ from 'underscore';
-
const STORAGE_KEY = 'sonar_recent_history';
const HISTORY_LIMIT = 10;
@@ -51,16 +49,16 @@ export default class RecentHistory {
if (componentKey) {
const newEntry = { key: componentKey, name: componentName, icon };
- let newHistory = _.reject(sonarHistory, entry => entry.key === newEntry.key);
+ let newHistory = sonarHistory.filter(entry => entry.key !== newEntry.key);
newHistory.unshift(newEntry);
- newHistory = _.first(newHistory, HISTORY_LIMIT);
+ newHistory = newHistory.slice(0, HISTORY_LIMIT);
RecentHistory.set(newHistory);
}
}
static remove (componentKey) {
const history = RecentHistory.get();
- const newHistory = _.reject(history, entry => entry.key === componentKey);
+ const newHistory = history.filter(entry => entry.key !== componentKey);
RecentHistory.set(newHistory);
}
}