session list: fix "remove from history" always removing the first item in the list (#264)

This commit is contained in:
bordun 2018-03-28 15:37:25 +02:00
parent 63ca242657
commit e40d7f8e3b
2 changed files with 6 additions and 2 deletions

View file

@ -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

View file

@ -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) {