cleaned up a minor leak...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2018-01-04 02:53:40 +03:00
parent b21e15fb23
commit ff05a7dc2e
2 changed files with 19 additions and 7 deletions

View File

@ -1217,7 +1217,13 @@ module.TagsEditActions = actions.Actions({
tags = tags instanceof Array ? tags : [tags]
var that = this
gids = gids.map(function(gid){ return that.data.getImage(gid) })
gids = gids
.map(function(gid){ return that.data.getImage(gid) })
.filter(function(gid){ return gid != null })
if(gids.length == 0){
return
}
// data...
this.data.tag(tags, gids)

View File

@ -37,14 +37,20 @@ var ui = require('features/ui')
function makeTagTogglerAction(tag){
// get actual target gids...
var _getTarget = function(target){
target = target || 'current'
target = target || this.current
target = target == 'all'
|| target == 'loaded'
|| target in this.data.ribbons
? this.data.getImages(target)
: target == 'ribbon' ? this.data.getImages('current')
|| target == 'loaded'
|| target in this.data.ribbons
?
this.data.getImages(target)
: target == 'ribbon' ?
this.data.getImages('current')
: target
return target instanceof Array ? target : [target]
return target == null ?
[]
: target instanceof Array ?
target
: [target]
}
// the toggler...