From e40d7f8e3b7cae7b5b3b591759e44b5f2e5285c4 Mon Sep 17 00:00:00 2001 From: bordun Date: Wed, 28 Mar 2018 15:37:25 +0200 Subject: [PATCH] session list: fix "remove from history" always removing the first item in the list (#264) --- CHANGELOG.md | 2 ++ app/main/callbacks.js | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a4dc63a..6881d4d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## next +- bug fixes + - session list: fix "remove from history" always removing the first item in the list - custom module - expose `setInterval` - prevent errors when failing to run the module diff --git a/app/main/callbacks.js b/app/main/callbacks.js index be4b0303..40e03758 100644 --- a/app/main/callbacks.js +++ b/app/main/callbacks.js @@ -59,8 +59,10 @@ module.exports = { sessionRemoveFromHistory: function(data) { var sessionlist = settings.read('recentSessions') - sessionlist.splice(data,1) - settings.write('recentSessions',sessionlist) + if (sessionlist.indexOf(data) > -1) { + sessionlist.splice(sessionlist.indexOf(data),1) + settings.write('recentSessions',sessionlist) + } }, sessionOpen: function(data,clientId) {