From a1e1f5a8774c9f269b5fdf3620ab28fa5140a5b0 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Mon, 19 Jun 2017 16:19:48 +0500 Subject: Optimize store selection --- web/app/AttributeFormatter.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'web/app/AttributeFormatter.js') diff --git a/web/app/AttributeFormatter.js b/web/app/AttributeFormatter.js index f8bce1b..2ddfd61 100644 --- a/web/app/AttributeFormatter.js +++ b/web/app/AttributeFormatter.js @@ -65,11 +65,7 @@ Ext.define('Traccar.AttributeFormatter', { groupIdFormatter: function (value) { var group; if (value !== 0) { - if (Ext.getStore('AllGroups').getTotalCount() === 0) { - group = Ext.getStore('Groups').getById(value); - } else { - group = Ext.getStore('AllGroups').getById(value); - } + group = Ext.getStore(Ext.getStore('AllGroups').getTotalCount() === 0 ? 'Groups' : 'AllGroups').getById(value); return group ? group.get('name') : value; } }, -- cgit v1.2.3