From 17157262fef1c046d116b2270f4e1d335fe9da1b Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Tue, 26 Jun 2018 12:00:15 +0500 Subject: Implement refactored notifications --- web/app/AttributeFormatter.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'web/app/AttributeFormatter.js') diff --git a/web/app/AttributeFormatter.js b/web/app/AttributeFormatter.js index b2286249..c2793827 100644 --- a/web/app/AttributeFormatter.js +++ b/web/app/AttributeFormatter.js @@ -73,7 +73,16 @@ Ext.define('Traccar.AttributeFormatter', { }, deviceIdFormatter: function (value) { - return Ext.getStore('Devices').getById(value).get('name'); + var device, store; + if (value !== 0) { + store = Ext.getStore('AllDevices'); + if (store.getTotalCount() === 0) { + store = Ext.getStore('Devices'); + } + device = store.getById(value); + return device ? device.get('name') : ''; + } + return null; }, groupIdFormatter: function (value) { -- cgit v1.2.3