From 227971b2d28c8005ebf2ea3b8a135687a8ae0a17 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 7 Feb 2022 20:43:34 -0800 Subject: Select device based on uniqueId --- web/app/controller/Root.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'web') diff --git a/web/app/controller/Root.js b/web/app/controller/Root.js index 65b56fa6..a37bc06f 100644 --- a/web/app/controller/Root.js +++ b/web/app/controller/Root.js @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2017 Anton Tananaev (anton@traccar.org) + * Copyright 2015 - 2022 Anton Tananaev (anton@traccar.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -308,7 +308,7 @@ Ext.define('Traccar.controller.Root', { }, updatePositions: function (array, first) { - var i, store, entity, deviceId, device; + var i, store, entity, uniqueId, device; store = Ext.getStore('LatestPositions'); for (i = 0; i < array.length; i++) { entity = store.findRecord('deviceId', array[i].deviceId, 0, false, false, true); @@ -322,9 +322,9 @@ Ext.define('Traccar.controller.Root', { } } if (first) { - deviceId = Ext.Object.fromQueryString(window.location.search).deviceId; - if (deviceId) { - device = Ext.getStore('VisibleDevices').findRecord('id', deviceId, 0, false, true, true); + uniqueId = Ext.Object.fromQueryString(window.location.search).deviceId; + if (uniqueId) { + device = Ext.getStore('VisibleDevices').findRecord('uniqueId', uniqueId, 0, false, true, true); if (device) { this.fireEvent('selectdevice', device, true); } -- cgit v1.2.3